summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile26
-rw-r--r--hugin.h15
-rw-r--r--hugin_filter.c4
-rw-r--r--hugin_filter.h4
-rw-r--r--hugin_util.h4
5 files changed, 40 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 7e35afa..c687d76 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ include Makefile.files
CFLAGS=-Werror -Wall -D_FORTIFY_SOURCE=2 -g -O2
CXXFLAGS=$(CFLAGS)
-all: complete obj simple syslog filter mutex minimal
+all: complete obj simple syslog filter mutex minimal disabled
complete:
gcc ${CFLAGS} ${HUGIN_SOURCES} main_complete.c -o hugin-complete -DWITH_HUG_SYSLOG -DWITH_HUG_FILTER -DWITH_HUG_MUTEX
@@ -29,16 +29,32 @@ minimal:
g++ ${CXXFLAGS} hugin.c main_minimal.c -o hugin-minimal
syslog:
- gcc ${CFLAGS} hugin.c hugin_syslog.c main_syslog.c -o hugin-syslog -DWITH_HUG_SYSLOG
- g++ ${CXXFLAGS} hugin.c hugin_syslog.c main_syslog.c -o hugin-syslog -DWITH_HUG_SYSLOG
+ gcc ${CFLAGS} hugin.c hugin_syslog.c main_syslog.c \
+ -o hugin-syslog -DWITH_HUG_SYSLOG
+ g++ ${CXXFLAGS} hugin.c hugin_syslog.c main_syslog.c \
+ -o hugin-syslog -DWITH_HUG_SYSLOG
filter:
- gcc ${CFLAGS} hugin.c hugin_filter.c main_filter.c -o hugin-filter -DWITH_HUG_FILTER
- g++ ${CXXFLAGS} hugin.c hugin_filter.c main_filter.c -o hugin-filter -DWITH_HUG_FILTER
+ gcc ${CFLAGS} hugin.c hugin_filter.c main_filter.c -o hugin-filter \
+ -DWITH_HUG_FILTER
+ g++ ${CXXFLAGS} hugin.c hugin_filter.c main_filter.c -o hugin-filter \
+ -DWITH_HUG_FILTER
mutex:
gcc ${CFLAGS} hugin.c main_mutex.c -o hugin-mutex -DWITH_HUG_MUTEX
g++ ${CXXFLAGS} hugin.c main_mutex.c -o hugin-mutex -DWITH_HUG_MUTEX
+disabled:
+ gcc -DDISABLE_HUGIN ${CFLAGS} hugin.c main_simple.c \
+ -o hugin-simple-disabled
+ g++ -DDISABLE_HUGIN ${CXXFLAGS} hugin.c main_simple.c \
+ -o hugin-simple-disabled
+ gcc -DDISABLE_HUGIN ${CFLAGS} ${HUGIN_SOURCES} main_complete.c \
+ -o hugin-complete-disabled -DWITH_HUG_SYSLOG -DWITH_HUG_FILTER \
+ -DWITH_HUG_MUTEX
+ g++ -DDISABLE_HUGIN ${CXXFLAGS} ${HUGIN_SOURCES} main_complete.c \
+ -o hugin-complete-disabled -DWITH_HUG_SYSLOG -DWITH_HUG_FILTER \
+ -DWITH_HUG_MUTEX
+
clean:
rm -f hugin_{complete,complete-cpp,simple,syslog,filter,mutex,minimal} \ No newline at end of file
diff --git a/hugin.h b/hugin.h
index 88199a9..8aabcf1 100644
--- a/hugin.h
+++ b/hugin.h
@@ -28,14 +28,19 @@
#ifndef __HUGIN_HUGIN_H__
#define __HUGIN_HUGIN_H__
+typedef enum {
+ HUG_STATUS_OK = 0,
+ HUG_STATUS_UNKNOWN_OPTION,
+ HUG_STATUS_ERROR,
+} hug_status_t;
+
#ifdef DISABLE_HUGIN
#define ERR(ch, fmt...)
#define WARN(ch, fmt...)
#define INFO(ch, fmt...)
#define DEBUG(ch, fmt...)
-typedef int hug_status_t;
-#define hug_init(...) 0
+#define hug_init(...) HUG_STATUS_OK
#define hug_close()
#else/*DISABLE_HUGIN*/
@@ -122,12 +127,6 @@ enum HUG_OPTION {
#endif
};
-typedef enum {
- HUG_STATUS_OK = 0,
- HUG_STATUS_UNKNOWN_OPTION,
- HUG_STATUS_ERROR,
-} hug_status_t;
-
/**
* @param flags combination of HUG_FLAG values
* @param ... list of options (type-value pairs,
diff --git a/hugin_filter.c b/hugin_filter.c
index f817145..8297c91 100644
--- a/hugin_filter.c
+++ b/hugin_filter.c
@@ -27,6 +27,8 @@
*/
#include "hugin_filter.h"
+#ifndef DISABLE_HUGIN
+
#include <string.h>
#include <stdlib.h>
@@ -129,3 +131,5 @@ int hug_filter_parse(const char *filter)
return 0;
}
+
+#endif/*DISABLE_HUGIN*/
diff --git a/hugin_filter.h b/hugin_filter.h
index 7d2a09a..b15d816 100644
--- a/hugin_filter.h
+++ b/hugin_filter.h
@@ -28,9 +28,13 @@
#ifndef __HUGIN_HUGIN_FILTER_H__
#define __HUGIN_HUGIN_FILTER_H__
+#ifndef DISABLE_HUGIN
+
#include "hugin.h"
int hug_filter_enabled(const enum __debug_class cl, const char *ch);
int hug_filter_parse(const char *filter);
+#endif/*DISABLE_HUGIN*/
+
#endif/*__HUGIN_HUGIN_FILTER_H__*/
diff --git a/hugin_util.h b/hugin_util.h
index 9cf48ba..0bf86d4 100644
--- a/hugin_util.h
+++ b/hugin_util.h
@@ -28,6 +28,8 @@
#ifndef __HUGIN_HUGIN_UTIL_H__
#define __HUGIN_HUGIN_UTIL_H__
+#ifndef DISABLE_HUGIN
+
#include <time.h>
/**
@@ -36,4 +38,6 @@
*/
struct tm *hug_localtime(const time_t *timep, struct tm *result);
+#endif/*DISABLE_HUGIN*/
+
#endif/*__HUGIN_HUGIN_UTIL_H__*/