# HG changeset patch # User Matti Hamalainen # Date 1317645654 -10800 # Node ID 598609fb49b06e34f96230f464fef400bafeb2d8 # Parent 55e36ec0588119574e4fffb15023317807ad041f Change how "config.h" is included, etc. diff -r 55e36ec05881 -r 598609fb49b0 th_args.c --- a/th_args.c Mon Oct 03 15:39:42 2011 +0300 +++ b/th_args.c Mon Oct 03 15:40:54 2011 +0300 @@ -116,12 +116,12 @@ */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#ifdef EXTERNAL +#else #include "th_util.h" #include "th_args.h" #include "th_string.h" +#endif /* Check if option requires an argument diff -r 55e36ec05881 -r 598609fb49b0 th_args.h --- a/th_args.h Mon Oct 03 15:39:42 2011 +0300 +++ b/th_args.h Mon Oct 03 15:40:54 2011 +0300 @@ -5,17 +5,16 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifndef _TH_ARGS -#define _TH_ARGS +#ifndef TH_ARGS +#define TH_ARGS + +#include "th_util.h" +#include #ifdef __cplusplus extern "C" { #endif -#include -#include "th_util.h" - - /* Option flags */ #define OPT_NONE (0) /* Simple option with no arguments */ @@ -44,4 +43,4 @@ #ifdef __cplusplus } #endif -#endif /* _TH_ARGS */ +#endif /* TH_ARGS */ diff -r 55e36ec05881 -r 598609fb49b0 th_config.c --- a/th_config.c Mon Oct 03 15:39:42 2011 +0300 +++ b/th_config.c Mon Oct 03 15:40:54 2011 +0300 @@ -5,14 +5,11 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "th_util.h" +#include "th_config.h" +#include "th_string.h" #include #include -#include "th_config.h" -#include "th_util.h" -#include "th_string.h" #define SET_MAX_BUF (8192) diff -r 55e36ec05881 -r 598609fb49b0 th_config.h --- a/th_config.h Mon Oct 03 15:39:42 2011 +0300 +++ b/th_config.h Mon Oct 03 15:40:54 2011 +0300 @@ -5,8 +5,8 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifndef _TH_CONFIG_H -#define _TH_CONFIG_H +#ifndef TH_CONFIG_H +#define TH_CONFIG_H #ifdef __cplusplus extern "C" { @@ -71,4 +71,4 @@ #ifdef __cplusplus } #endif -#endif /* _TH_CONFIG_H */ +#endif /* TH_CONFIG_H */ diff -r 55e36ec05881 -r 598609fb49b0 th_endian.h --- a/th_endian.h Mon Oct 03 15:39:42 2011 +0300 +++ b/th_endian.h Mon Oct 03 15:40:54 2011 +0300 @@ -5,14 +5,14 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifndef _TH_ENDIAN_H -#define _TH_ENDIAN_H +#ifndef TH_ENDIAN_H +#define TH_ENDIAN_H #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" #endif +#include "th_types.h" #include -#include "th_types.h" #ifdef __cplusplus extern "C" { @@ -118,4 +118,4 @@ #ifdef __cplusplus } #endif -#endif /* _TH_ENDIAN_H */ +#endif /* TH_ENDIAN_H */ diff -r 55e36ec05881 -r 598609fb49b0 th_string.c --- a/th_string.c Mon Oct 03 15:39:42 2011 +0300 +++ b/th_string.c Mon Oct 03 15:40:54 2011 +0300 @@ -5,9 +5,7 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "th_util.h" #include "th_string.h" /* strdup with a NULL check diff -r 55e36ec05881 -r 598609fb49b0 th_string.h --- a/th_string.h Mon Oct 03 15:39:42 2011 +0300 +++ b/th_string.h Mon Oct 03 15:40:54 2011 +0300 @@ -5,8 +5,8 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifndef _TH_STRING_H -#define _TH_STRING_H +#ifndef TH_STRING_H +#define TH_STRING_H #ifdef __cplusplus extern "C" { @@ -76,4 +76,4 @@ #ifdef __cplusplus } #endif -#endif /* _TH_STRING_H */ +#endif /* TH_STRING_H */ diff -r 55e36ec05881 -r 598609fb49b0 th_util.c --- a/th_util.c Mon Oct 03 15:39:42 2011 +0300 +++ b/th_util.c Mon Oct 03 15:40:54 2011 +0300 @@ -5,9 +5,6 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include "th_util.h" #include diff -r 55e36ec05881 -r 598609fb49b0 th_util.h --- a/th_util.h Mon Oct 03 15:39:42 2011 +0300 +++ b/th_util.h Mon Oct 03 15:40:54 2011 +0300 @@ -5,11 +5,11 @@ * * Please read file 'COPYING' for information on license and distribution. */ -#ifndef _TH_UTIL_H -#define _TH_UTIL_H +#ifndef TH_UTIL_H +#define TH_UTIL_H -#ifdef __cplusplus -extern "C" { +#ifdef HAVE_CONFIG_H +#include "config.h" #endif #include "th_types.h" @@ -34,6 +34,9 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif #ifdef TH_NO_DEFAULTS #define TH_PROG_AUTHOR NULL @@ -131,4 +134,4 @@ #ifdef __cplusplus } #endif -#endif /* _TH_UTIL_H */ +#endif /* TH_UTIL_H */