lib: Ensure we use _GNU_SOURCE in enum templates

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
This commit is contained in:
Colin Walters 2016-12-06 11:30:19 -05:00 committed by Atomic Bot
parent a2d627352d
commit 099576ee4a
1 changed files with 6 additions and 0 deletions

View File

@ -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@"