From 099576ee4a8f5f23e17def823c44c5de31b14d5d Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 6 Dec 2016 11:30:19 -0500 Subject: [PATCH] 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 --- src/libostree/ostree-enumtypes.c.template | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libostree/ostree-enumtypes.c.template b/src/libostree/ostree-enumtypes.c.template index ab1b2aec..52da7de1 100644 --- a/src/libostree/ostree-enumtypes.c.template +++ b/src/libostree/ostree-enumtypes.c.template @@ -18,9 +18,15 @@ * Boston, MA 02111-1307, USA. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include + /*** END file-header ***/ /*** BEGIN file-production ***/ + /* enumerations from "@filename@" */ #include "@filename@"