diff --git a/glfw/ibus_glfw.c b/glfw/ibus_glfw.c index e068bec9e..fd4af17c9 100644 --- a/glfw/ibus_glfw.c +++ b/glfw/ibus_glfw.c @@ -47,6 +47,20 @@ enum Capabilities { IBUS_CAP_SURROUNDING_TEXT = 1 << 5 }; +// implement strdup ourselves because the various unix/libc flavors all +// require different sets of macros to make it available, and I cannot be +// bothered +static inline char* +strdup(const char *src) { + size_t len = strlen(src); + char *ans = malloc(len + 1); + if (ans) { + memcpy(ans, src, len); + ans[len] = 0; + } + return ans; +} + static inline GLFWbool test_env_var(const char *name, const char *val) { diff --git a/setup.py b/setup.py index 9b89ba18f..a28550a7c 100755 --- a/setup.py +++ b/setup.py @@ -181,7 +181,7 @@ def init_env( sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set() cppflags = os.environ.get( 'OVERRIDE_CPPFLAGS', ( - '-D_XOPEN_SOURCE=700 -D{}DEBUG' + '-D{}DEBUG' ).format( ('' if debug else 'N'), )