Browse Source

Fix new test under linux

tags/v2.1-alpha1-winvst
falkTX 6 years ago
parent
commit
13a5b3ad09
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      source/tests/Makefile
  2. +2
    -2
      source/tests/ctypes-test.c

+ 1
- 1
source/tests/Makefile View File

@@ -122,7 +122,7 @@ ansi-pedantic-test_cxxlang: ansi-pedantic-test.cpp ../backend/Carla*.h ../includ
# -------------------------------------------------------------- # --------------------------------------------------------------


ctypes-test.so: ctypes-test.c .FORCED ctypes-test.so: ctypes-test.c .FORCED
$(CC) $< $(PEDANTIC_C_FLAGS) -shared -o $@
$(CC) $< $(BASE_FLAGS) -fPIC -shared -o $@
set -e; ./ctypes-test.py set -e; ./ctypes-test.py


# -------------------------------------------------------------- # --------------------------------------------------------------


+ 2
- 2
source/tests/ctypes-test.c View File

@@ -2,17 +2,17 @@
#include <stdio.h> #include <stdio.h>


typedef void (*PythonSideFn)(int checker); typedef void (*PythonSideFn)(int checker);
__attribute__ ((visibility("default"))) void set_python_side_fn(PythonSideFn fn);
__attribute__ ((visibility("default"))) void call_python_side_fn(void);


PythonSideFn pyFn = NULL; PythonSideFn pyFn = NULL;


__attribute__ ((visibility("default")))
void set_python_side_fn(PythonSideFn fn) void set_python_side_fn(PythonSideFn fn)
{ {
printf("set_python_side_fn(%p)\n", fn); printf("set_python_side_fn(%p)\n", fn);
pyFn = fn; pyFn = fn;
} }


__attribute__ ((visibility("default")))
void call_python_side_fn(void) void call_python_side_fn(void)
{ {
assert(pyFn != NULL); assert(pyFn != NULL);


Loading…
Cancel
Save