diff options
author | Dmitri Pal <dpal@redhat.com> | 2012-12-23 13:03:00 -0500 |
---|---|---|
committer | Ondrej Kos <okos@redhat.com> | 2013-01-24 08:34:37 +0100 |
commit | 57faa64667411a3d8eeeeff62b1e659a94ed29cf (patch) | |
tree | 229c850672e485e62fce866cf1b14fb65a5a4c06 | |
parent | 360710d1a6c0c24d00a915a630884281b0b9e665 (diff) | |
download | ding-libs-57faa64667411a3d8eeeeff62b1e659a94ed29cf.tar.gz ding-libs-57faa64667411a3d8eeeeff62b1e659a94ed29cf.tar.xz ding-libs-57faa64667411a3d8eeeeff62b1e659a94ed29cf.zip |
Fixing headers
Move GNU_SOUCE definition to configure.ac
Change all headers to use config.h.
Move config.h to the top.
Remove errno.h if it is not needed.
36 files changed, 36 insertions, 67 deletions
diff --git a/basicobjects/simplebuffer.c b/basicobjects/simplebuffer.c index b47d6b6..1e7b3fb 100644 --- a/basicobjects/simplebuffer.c +++ b/basicobjects/simplebuffer.c @@ -17,8 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -#define _GNU_SOURCE +#include "config.h" #include <errno.h> /* for errors */ #include <stdlib.h> /* for free() */ #include <unistd.h> /* for write() */ @@ -26,7 +25,6 @@ #include "simplebuffer.h" #include "trace.h" -#include "config.h" /* End line string */ #define ENDLNSTR "\n" diff --git a/basicobjects/simplebuffer_ut.c b/basicobjects/simplebuffer_ut.c index 61272da..ba9d172 100644 --- a/basicobjects/simplebuffer_ut.c +++ b/basicobjects/simplebuffer_ut.c @@ -17,10 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <errno.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> diff --git a/collection/collection.c b/collection/collection.c index d836aa4..fa33cb8 100644 --- a/collection/collection.c +++ b/collection/collection.c @@ -19,13 +19,12 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <string.h> #include <stdlib.h> #include <errno.h> #include <ctype.h> #include <time.h> -#include "config.h" #include "trace.h" /* The collection should use the real structures */ diff --git a/collection/collection_cmp.c b/collection/collection_cmp.c index c1f9017..61d2fcc 100644 --- a/collection/collection_cmp.c +++ b/collection/collection_cmp.c @@ -19,13 +19,12 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <string.h> #include <stdlib.h> #include <errno.h> #include <ctype.h> #include <time.h> -#include "config.h" #include "trace.h" /* The collection should use the real structures */ diff --git a/collection/collection_cnv.c b/collection/collection_cnv.c index e9ca05d..c38f859 100644 --- a/collection/collection_cnv.c +++ b/collection/collection_cnv.c @@ -21,10 +21,9 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <string.h> #include <stdlib.h> -#include <errno.h> #include <ctype.h> #include <time.h> #include "trace.h" diff --git a/collection/collection_iter.c b/collection/collection_iter.c index f3735d7..9e0413c 100644 --- a/collection/collection_iter.c +++ b/collection/collection_iter.c @@ -19,13 +19,12 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <string.h> #include <stdlib.h> #include <errno.h> #include <ctype.h> #include <time.h> -#include "config.h" #include "trace.h" /* The collection should use the real structures */ diff --git a/collection/collection_queue.c b/collection/collection_queue.c index adac8ee..91b7099 100644 --- a/collection/collection_queue.c +++ b/collection/collection_queue.c @@ -19,6 +19,7 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdlib.h> #include <errno.h> #include "collection_queue.h" diff --git a/collection/collection_queue_ut.c b/collection/collection_queue_ut.c index fbe6ea3..c4f7a68 100644 --- a/collection/collection_queue_ut.c +++ b/collection/collection_queue_ut.c @@ -19,10 +19,9 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ - +#include "config.h" #include <stdio.h> #include <string.h> -#include <errno.h> #define TRACE_HOME #include "trace.h" #include "collection_queue.h" diff --git a/collection/collection_stack.c b/collection/collection_stack.c index 509df51..50ac531 100644 --- a/collection/collection_stack.c +++ b/collection/collection_stack.c @@ -19,6 +19,7 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdlib.h> #include <errno.h> #include "collection_stack.h" diff --git a/collection/collection_stack_ut.c b/collection/collection_stack_ut.c index e0633b7..9c25308 100644 --- a/collection/collection_stack_ut.c +++ b/collection/collection_stack_ut.c @@ -19,10 +19,9 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ - +#include "config.h" #include <stdio.h> #include <string.h> -#include <errno.h> #define TRACE_HOME #include "trace.h" #include "collection_stack.h" diff --git a/collection/collection_tools.c b/collection/collection_tools.c index b7f30d2..54d96c3 100644 --- a/collection/collection_tools.c +++ b/collection/collection_tools.c @@ -19,7 +19,7 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ - +#include "config.h" #include <stdio.h> #include <malloc.h> #include <errno.h> diff --git a/collection/collection_ut.c b/collection/collection_ut.c index c34cd36..2692879 100644 --- a/collection/collection_ut.c +++ b/collection/collection_ut.c @@ -19,7 +19,7 @@ along with Collection Library. If not, see <http://www.gnu.org/licenses/>. */ - +#include "config.h" #include <stdio.h> #include <string.h> #include <errno.h> diff --git a/configure.ac b/configure.ac index 2e22e8a..902ed86 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,7 @@ AC_INIT([ding-libs], [sssd-devel@lists.fedorahosted.org]) AC_CONFIG_SRCDIR([README]) AC_CONFIG_AUX_DIR([build]) +AC_GNU_SOURCE AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC AC_PROG_LIBTOOL diff --git a/dhash/dhash.c b/dhash/dhash.c index efd7c8d..8f7ea2d 100644 --- a/dhash/dhash.c +++ b/dhash/dhash.c @@ -40,6 +40,7 @@ /******************************* Include Files *******************************/ /*****************************************************************************/ +#include "config.h" #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ini/ini_comment.c b/ini/ini_comment.c index 6b56d02..3d25562 100644 --- a/ini/ini_comment.c +++ b/ini/ini_comment.c @@ -19,11 +19,10 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <string.h> #include <ctype.h> -#include "config.h" #include "trace.h" #include "ref_array.h" #include "simplebuffer.h" diff --git a/ini/ini_comment_ut.c b/ini/ini_comment_ut.c index 3d01790..eb46360 100644 --- a/ini/ini_comment_ut.c +++ b/ini/ini_comment_ut.c @@ -19,9 +19,9 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdio.h> #include <string.h> -#include <errno.h> #include <stdlib.h> #define TRACE_HOME #include "trace.h" diff --git a/ini/ini_config.c b/ini/ini_config.c index f1e7cfd..4265f38 100644 --- a/ini/ini_config.c +++ b/ini/ini_config.c @@ -20,12 +20,11 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <string.h> #include <stdlib.h> #include <ctype.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_config_ut.c b/ini/ini_config_ut.c index 6c2e986..34b395b 100644 --- a/ini/ini_config_ut.c +++ b/ini/ini_config_ut.c @@ -19,6 +19,7 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> diff --git a/ini/ini_configobj.c b/ini/ini_configobj.c index e42d4d4..88b0279 100644 --- a/ini/ini_configobj.c +++ b/ini/ini_configobj.c @@ -19,12 +19,11 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <stdio.h> #include <string.h> #include <stdint.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "ini_config_priv.h" diff --git a/ini/ini_fileobj.c b/ini/ini_fileobj.c index 1410a90..c120180 100644 --- a/ini/ini_fileobj.c +++ b/ini/ini_fileobj.c @@ -19,11 +19,10 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <string.h> #include <stdlib.h> -#include "config.h" #include "trace.h" #include "ini_defines.h" #include "ini_configobj.h" diff --git a/ini/ini_get_array.c b/ini/ini_get_array.c index b2cbfac..30ed423 100644 --- a/ini/ini_get_array.c +++ b/ini/ini_get_array.c @@ -20,14 +20,13 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <locale.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_get_array_valueobj.c b/ini/ini_get_array_valueobj.c index 03fdd60..5be01aa 100644 --- a/ini/ini_get_array_valueobj.c +++ b/ini/ini_get_array_valueobj.c @@ -20,14 +20,13 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <locale.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_get_value.c b/ini/ini_get_value.c index f31077f..0afadd0 100644 --- a/ini/ini_get_value.c +++ b/ini/ini_get_value.c @@ -20,13 +20,12 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <ctype.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_get_valueobj.c b/ini/ini_get_valueobj.c index a1fa19b..a7efe95 100644 --- a/ini/ini_get_valueobj.c +++ b/ini/ini_get_valueobj.c @@ -20,13 +20,12 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> #include <ctype.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_list.c b/ini/ini_list.c index 95894a1..5fd0460 100644 --- a/ini/ini_list.c +++ b/ini/ini_list.c @@ -20,19 +20,9 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <stdio.h> #include <errno.h> -/* -#include <string.h> -#include <ctype.h> -#include <stdlib.h> -#include <locale.h> -#include <fcntl.h> -#include <unistd.h> -#include <limits.h> -*/ -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_list_valueobj.c b/ini/ini_list_valueobj.c index 8df6a18..bc94072 100644 --- a/ini/ini_list_valueobj.c +++ b/ini/ini_list_valueobj.c @@ -20,10 +20,9 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <stdio.h> #include <errno.h> -#include "config.h" #include "trace.h" #include "collection.h" #include "collection_tools.h" diff --git a/ini/ini_metadata.c b/ini/ini_metadata.c index f6d3545..ae36b72 100644 --- a/ini/ini_metadata.c +++ b/ini/ini_metadata.c @@ -19,12 +19,11 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <errno.h> -#include "config.h" #include "collection.h" #include "collection_tools.h" #include "trace.h" diff --git a/ini/ini_parse.c b/ini/ini_parse.c index 9e81f2d..5690c2c 100644 --- a/ini/ini_parse.c +++ b/ini/ini_parse.c @@ -19,14 +19,13 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <string.h> #include <ctype.h> /* For error text */ #include <libintl.h> #define _(String) gettext (String) -#include "config.h" #include "trace.h" #include "ini_defines.h" #include "ini_valueobj.h" diff --git a/ini/ini_parse_ut.c b/ini/ini_parse_ut.c index e743eae..5bf45b4 100644 --- a/ini/ini_parse_ut.c +++ b/ini/ini_parse_ut.c @@ -19,6 +19,7 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdio.h> #include <string.h> #include <errno.h> @@ -30,7 +31,6 @@ #include "ini_config_priv.h" #include "simplebuffer.h" #include "path_utils.h" -#include "config.h" #define TRACE_HOME #include "trace.h" #include "collection_tools.h" diff --git a/ini/ini_print.c b/ini/ini_print.c index 1128b70..d2d01c1 100644 --- a/ini/ini_print.c +++ b/ini/ini_print.c @@ -19,10 +19,8 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE -#include <stdio.h> -#include <errno.h> #include "config.h" +#include <stdio.h> /* For error text */ #include <libintl.h> #define _(String) gettext (String) diff --git a/ini/ini_serialize.c b/ini/ini_serialize.c index 7a53f29..dcda5ac 100644 --- a/ini/ini_serialize.c +++ b/ini/ini_serialize.c @@ -19,12 +19,11 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <stdio.h> #include <string.h> #include <stdint.h> -#include "config.h" #include "simplebuffer.h" #include "collection.h" #include "ini_valueobj.h" diff --git a/ini/ini_valueobj.c b/ini/ini_valueobj.c index 6d4dc1f..bee7688 100644 --- a/ini/ini_valueobj.c +++ b/ini/ini_valueobj.c @@ -19,11 +19,10 @@ along with INI Library. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> #include <stdio.h> #include <string.h> -#include "config.h" #include "simplebuffer.h" #include "ref_array.h" #include "ini_comment.h" diff --git a/ini/ini_valueobj_ut.c b/ini/ini_valueobj_ut.c index a35b239..eb7937c 100644 --- a/ini/ini_valueobj_ut.c +++ b/ini/ini_valueobj_ut.c @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> /* for errors */ #include <stdint.h> #include <stdio.h> @@ -27,7 +27,6 @@ #include "ini_valueobj.h" #include "ini_defines.h" -#include "config.h" #define TRACE_HOME #include "trace.h" diff --git a/path_utils/path_utils_ut.c b/path_utils/path_utils_ut.c index 174e02d..cdbdf33 100644 --- a/path_utils/path_utils_ut.c +++ b/path_utils/path_utils_ut.c @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE /* asprintf */ +#include "config.h" #include <check.h> #include <stdlib.h> diff --git a/refarray/ref_array.c b/refarray/ref_array.c index 393f236..273ac4f 100644 --- a/refarray/ref_array.c +++ b/refarray/ref_array.c @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> /* for errors */ #include <stdint.h> #include <malloc.h> @@ -25,7 +25,6 @@ #include <stdio.h> #include "ref_array.h" -#include "config.h" #include "trace.h" /* The structure used in referenced array */ diff --git a/refarray/ref_array_ut.c b/refarray/ref_array_ut.c index fc9b557..343b7fa 100644 --- a/refarray/ref_array_ut.c +++ b/refarray/ref_array_ut.c @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#define _GNU_SOURCE +#include "config.h" #include <errno.h> /* for errors */ #include <stdint.h> #include <stdio.h> @@ -25,7 +25,6 @@ #include <stdlib.h> #include "ref_array.h" -#include "config.h" #define TRACE_HOME #include "trace.h" |