changeset 49:598609fb49b0

Change how "config.h" is included, etc.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Oct 2011 15:40:54 +0300
parents 55e36ec05881
children 1fa969d0f551
files th_args.c th_args.h th_config.c th_config.h th_endian.h th_string.c th_string.h th_util.c th_util.h
diffstat 9 files changed, 32 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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 <stdio.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <stdio.h>
-#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 */
--- 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 <stdio.h>
 #include <stdarg.h>
-#include "th_config.h"
-#include "th_util.h"
-#include "th_string.h"
 
 #define SET_MAX_BUF     (8192)
 
--- 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 */
--- 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 <stdio.h>
-#include "th_types.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -118,4 +118,4 @@
 #ifdef __cplusplus
 }
 #endif
-#endif /* _TH_ENDIAN_H */
+#endif /* TH_ENDIAN_H */
--- 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
--- 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 */
--- 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 <stdio.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 <memory.h>
 #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 */