#ifndef _HAPROXY_BUG_H
#define _HAPROXY_BUG_H
+#include <haproxy/atomic.h>
#include <haproxy/compiler.h>
/* quick debugging hack, should really be removed ASAP */
*__x = NULL; \
} while (0)
+
+/* handle 'tainted' status */
+enum tainted_flags {
+ TAINTED_CONFIG_EXP_KW_DECLARED = 0x00000001,
+ TAINTED_ACTION_EXP_EXECUTED = 0x00000002,
+ TAINTED_CLI_EXPERT_MODE = 0x00000004,
+ TAINTED_CLI_EXPERIMENTAL_MODE = 0x00000008,
+};
+
+/* this is a bit field made of TAINTED_*, and is declared in haproxy.c */
+extern unsigned int tainted;
+
+static inline void mark_tainted(const enum tainted_flags flag)
+{
+ HA_ATOMIC_OR(&tainted, flag);
+}
+
+static inline unsigned int get_tainted()
+{
+ return HA_ATOMIC_LOAD(&tainted);
+}
+
#if defined(DEBUG_MEM_STATS)
#include <stdlib.h>
#include <string.h>
return mask ? mask : 1;
}
-/* handle 'tainted' status */
-enum tainted_flags {
- TAINTED_CONFIG_EXP_KW_DECLARED = 0x1,
- TAINTED_ACTION_EXP_EXECUTED = 0x2,
- TAINTED_CLI_EXPERT_MODE = 0x4,
- TAINTED_CLI_EXPERIMENTAL_MODE = 0x8,
-};
-void mark_tainted(const enum tainted_flags flag);
-unsigned int get_tainted(void);
-
extern unsigned int experimental_directives_allowed;
struct cfg_keyword;
unsigned int warned = 0;
/* set if experimental features have been used for the current process */
-static unsigned int tainted = 0;
+unsigned int tainted = 0;
unsigned int experimental_directives_allowed = 0;
return ret == 0;
}
-void mark_tainted(const enum tainted_flags flag)
-{
- HA_ATOMIC_OR(&tainted, flag);
-}
-
-unsigned int get_tainted()
-{
- return HA_ATOMIC_LOAD(&tainted);
-}
-
-
/* This performs th every basic early initialization at the end of the PREPARE
* init stage. It may only assume that list heads are initialized, but not that
* anything else is correct. It will initialize a number of variables that