Commit 40728aca authored by Robert Izzard's avatar Robert Izzard
Browse files

fix for latest binary_c function hooks

clean up build warnings : binary_c-python should check
-D__HAVE_* macros and pass these on to its own build
before loading binary_c.h
parent 6fd05661
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5,8 +5,10 @@
/*
 * Include binary_C's API
 */
//#define __HAVE_ATTRIBUTE_UNUSED__
#include "binary_c.h"


/* Binary_c's python API prototypes */
int run_system(char * argstring,
               long int custom_logging_func_memaddr,
+11 −2
Original line number Diff line number Diff line
@@ -147,7 +147,8 @@ check_version(BINARY_C_VERSION[0], REQUIRED_BINARY_C_VERSIONS)

BINARY_C_INCDIRS = call_binary_c_config(BINARY_C_DIR, "incdirs_list")
BINARY_C_LIBDIRS = call_binary_c_config(BINARY_C_DIR, "libdirs_list")
BINARY_C_CFLAGS = call_binary_c_config(BINARY_C_DIR, "cflags")
binary_c_cflags = call_binary_c_config(BINARY_C_DIR, "cflags")
BINARY_C_CFLAGS = binary_c_cflags
# BINARY_C_CFLAGS.remove('-fvisibility=hidden')
BINARY_C_LIBS = call_binary_c_config(BINARY_C_DIR, "libs_list")
BINARY_C_DEFINES = call_binary_c_config(BINARY_C_DIR, "define_macros")
@@ -165,6 +166,14 @@ for x in BINARY_C_DEFINES:
        if y:
            BINARY_C_DEFINE_MACROS.extend([(y.group(1), None)])

# create a list of defined features/present libraries
BINARY_C_ATTRIBUTE_MACROS = []
for flag in binary_c_cflags:
    if flag.startswith('-D__HAVE_'):
        y = LONE.match(flag)
        if y:
            BINARY_C_ATTRIBUTE_MACROS.extend([(y.group(1),"1")])

# add API header file
API_h = os.path.join(BINARY_C_DIR, "src", "API", "binary_c_API.h")

@@ -214,7 +223,7 @@ BINARY_C_PYTHON_API_MODULE = Extension(
    libraries=LIBRARIES,
    library_dirs=LIBRARY_DIRS,
    runtime_library_dirs=RUNTIME_LIBRARY_DIRS,
    define_macros=[] + BINARY_C_DEFINE_MACROS,
    define_macros=[] + BINARY_C_DEFINE_MACROS + BINARY_C_ATTRIBUTE_MACROS,
    extra_objects=[],
    extra_compile_args=[],
    language="C",
+1 −1
Original line number Diff line number Diff line
@@ -850,7 +850,7 @@ int run_system(char * argstring,
    /* Check the value of the custom_logging_memaddr */
    if(custom_logging_func_memaddr != -1)
    {
        stardata->preferences->custom_output_function = (void*)(struct stardata_t *)custom_logging_func_memaddr;
        stardata->preferences->function_hooks[BINARY_C_HOOK_custom_output] = (void*)(struct stardata_t *)custom_logging_func_memaddr;
    }

    debug_printf("ensemble_defer: %d\n", stardata->preferences->ensemble_defer);