Skip to content

Commit

Permalink
Fix Cygwin compatibility – part III
Browse files Browse the repository at this point in the history
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 <sw@weilnetz.de>
  • Loading branch information
stweil committed Jun 19, 2016
1 parent 96720c7 commit ed053aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions training/pango_font_info.cpp
Expand Up @@ -25,14 +25,14 @@
#if (defined __MINGW32__) || (defined __CYGWIN__)
// workaround for stdlib.h and putenv
#undef __STRICT_ANSI__
#endif

#if (defined __MINGW32__)
#include "strcasestr.h"
#else
#elif !defined(_GNU_SOURCE)
// needed for strcasestr in string.h
#define _GNU_SOURCE
#endif
#endif

#include <stdlib.h>
#include <stdio.h>
Expand Down

0 comments on commit ed053aa

Please sign in to comment.