Skip to content

Commit

Permalink
lib: Ensure we use _GNU_SOURCE in enum templates
Browse files Browse the repository at this point in the history
Due to the way glib-mkenums runs the preprocessor itself, it
doesn't pick up the `AC_USE_SYSTEM_EXTENSIONS()` that we have in
`configure.ac`.

This blew up in an obscure way when I later wanted to `#include
"libglnx.h"` in one of the headers, since it needs the `basename()`
from `string.h` which is only available with `_GNU_SOURCE`.

Closes: #616
Approved by: jlebon
  • Loading branch information
cgwalters authored and rh-atomic-bot committed Dec 7, 2016
1 parent a2d6273 commit 099576e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libostree/ostree-enumtypes.c.template
Expand Up @@ -18,9 +18,15 @@
* Boston, MA 02111-1307, USA.
*/

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <string.h>

/*** END file-header ***/

/*** BEGIN file-production ***/

/* enumerations from "@filename@" */
#include "@filename@"

Expand Down

0 comments on commit 099576e

Please sign in to comment.