Skip to content

Commit ed053aa

Browse files
committed
Fix Cygwin compatibility – part III
Commit 65504c8 misplaced the #endif. The definition of _GNU_SOURCE is only needed for Cygwin. Defining _GNU_SOURCE on Linux results in compiler warnings because this macro is already defined by the compiler. Fix this by moving the #endif to the right place. In addition the code for Cygwin is made more robust: If a future Cygwin compiler defines _GNU_SOURCE, too, the code will still work. Signed-off-by: Stefan Weil <[email protected]>
1 parent 96720c7 commit ed053aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

training/pango_font_info.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
#if (defined __MINGW32__) || (defined __CYGWIN__)
2626
// workaround for stdlib.h and putenv
2727
#undef __STRICT_ANSI__
28-
#endif
2928

3029
#if (defined __MINGW32__)
3130
#include "strcasestr.h"
32-
#else
31+
#elif !defined(_GNU_SOURCE)
3332
// needed for strcasestr in string.h
3433
#define _GNU_SOURCE
3534
#endif
35+
#endif
3636

3737
#include <stdlib.h>
3838
#include <stdio.h>

0 commit comments

Comments
 (0)