Dont use _XOPEN_SOURCE when building

Apparently it has exactly opposite semantics for glibc and whatever libcs
are used on BSD. What a clusterfuck.
This commit is contained in:
Kovid Goyal
2018-07-28 22:56:18 +05:30
parent f018e1a075
commit 02635d506e
2 changed files with 15 additions and 1 deletions

14
glfw/ibus_glfw.c vendored
View File

@@ -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) {

View File

@@ -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'),
)