aboutsummaryrefslogtreecommitdiff
path: root/src/lib/conf
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-22 09:39:06 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-22 09:39:06 -0400
commitb2d487ae2249a307cd23255dbb1a22241eefd6ef (patch)
treecd754fbe8d1c13264749f997f1221b1635a97e49 /src/lib/conf
parent2d013bbe5cccaccf9ace0beec5a987fb80e850ad (diff)
parent7e7a4874b8fa333d1840cc5f2c0b118d6a0e7c47 (diff)
downloadtor-b2d487ae2249a307cd23255dbb1a22241eefd6ef.tar.gz
tor-b2d487ae2249a307cd23255dbb1a22241eefd6ef.zip
Merge branch 'ticket31705_v2' into ticket31705_v2_merged
Conflicts: src/feature/dirparse/authcert_parse.c src/feature/dirparse/ns_parse.c src/feature/hs/hs_service.c src/lib/conf/conftesting.h src/lib/log/log.h src/lib/thread/threads.h src/test/test_options.c These conflicts were mostly related to autostyle improvements, with one or two due to doxygen fixes.
Diffstat (limited to 'src/lib/conf')
-rw-r--r--src/lib/conf/confmacros.h2
-rw-r--r--src/lib/conf/conftesting.h9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/conf/confmacros.h b/src/lib/conf/confmacros.h
index 68121891f1..6449458a10 100644
--- a/src/lib/conf/confmacros.h
+++ b/src/lib/conf/confmacros.h
@@ -15,11 +15,13 @@
#include "orconfig.h"
#include "lib/conf/conftesting.h"
+#ifndef COCCI
/**
* Used to indicate the end of an array of configuration variables.
**/
#define END_OF_CONFIG_VARS \
{ .member = { .name = NULL } DUMMY_CONF_TEST_MEMBERS }
+#endif
/**
* Declare a config_var_t as a member named <b>membername</b> of the structure
diff --git a/src/lib/conf/conftesting.h b/src/lib/conf/conftesting.h
index f01f52d59e..8f82b5bf18 100644
--- a/src/lib/conf/conftesting.h
+++ b/src/lib/conf/conftesting.h
@@ -12,7 +12,9 @@
#ifndef TOR_LIB_CONF_CONFTESTING_H
#define TOR_LIB_CONF_CONFTESTING_H
+#ifndef COCCI
#ifdef TOR_UNIT_TESTS
+#define USE_CONF_TESTING
/**
* Union used when building in test mode typechecking the members of a type
* used with confparse.c. See CONF_CHECK_VAR_TYPE for a description of how
@@ -41,12 +43,10 @@ typedef union {
// XXXX this doesn't belong at this level of abstraction.
struct routerset_t **ROUTERSET;
} confparse_dummy_values_t;
-#endif /* defined(TOR_UNIT_TESTS) */
/* Macros to define extra members inside config_var_t fields, and at the
* end of a list of them.
*/
-#ifdef TOR_UNIT_TESTS
/* This is a somewhat magic type-checking macro for users of confparse.c.
* It initializes a union member "confparse_dummy_values_t.conftype" with
* the address of a static member "tp_dummy.member". This
@@ -72,9 +72,10 @@ typedef union {
#define DUMMY_CONF_TEST_MEMBERS , .var_ptr_dummy={ .INT=NULL }
#define DUMMY_TYPECHECK_INSTANCE(tp) \
static tp tp ## _dummy
+#endif
+#endif
-#else /* !defined(TOR_UNIT_TESTS) */
-
+#ifndef USE_CONF_TESTING
#define CONF_TEST_MEMBERS(tp, conftype, member)
/* Repeatedly declarable incomplete struct to absorb redundant semicolons */
#define DUMMY_TYPECHECK_INSTANCE(tp) \