extern "C" {
#endif
+/*
+ * The ubiquitous stringify macros
+ */
+#define XSTRINGIFY(x) #x
+#define STRINGIFY(x) XSTRINGIFY(x)
+
/*
* Macros for controlling warnings in GCC >= 4.2 and clang >= 2.8
*/
-#define DIAG_STR(s) #s
-#define DIAG_JOINSTR(x,y) DIAG_STR(x ## y)
+#define DIAG_JOINSTR(x,y) XSTRINGIFY(x ## y)
#define DIAG_DO_PRAGMA(x) _Pragma (#x)
#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
const void *dflt; /* default as it would appear in radiusd.conf */
} CONF_PARSER;
-/* This preprocessor trick will be useful in initializing CONF_PARSER struct */
-#define XStringify(x) #x
-#define Stringify(x) XStringify(x)
-
CONF_SECTION *cf_section_alloc(CONF_SECTION *parent, char const *name1,
char const *name2);
int cf_pair_replace(CONF_SECTION *cs, CONF_PAIR *cp,
{ "filename", PW_TYPE_FILE_OUTPUT | PW_TYPE_REQUIRED,
offsetof(listen_detail_t, filename), NULL, NULL },
{ "load_factor", PW_TYPE_INTEGER,
- offsetof(listen_detail_t, load_factor), NULL, Stringify(10)},
+ offsetof(listen_detail_t, load_factor), NULL, STRINGIFY(10)},
{ "poll_interval", PW_TYPE_INTEGER,
- offsetof(listen_detail_t, poll_interval), NULL, Stringify(1)},
+ offsetof(listen_detail_t, poll_interval), NULL, STRINGIFY(1)},
{ "retry_interval", PW_TYPE_INTEGER,
- offsetof(listen_detail_t, retry_interval), NULL, Stringify(30)},
+ offsetof(listen_detail_t, retry_interval), NULL, STRINGIFY(30)},
{ "one_shot", PW_TYPE_BOOLEAN,
offsetof(listen_detail_t, one_shot), NULL, NULL},
{ "max_outstanding", PW_TYPE_INTEGER,
* Security configuration for the server.
*/
static const CONF_PARSER security_config[] = {
- { "max_attributes", PW_TYPE_INTEGER, 0, &fr_max_attributes, Stringify(0) },
- { "reject_delay", PW_TYPE_INTEGER, 0, &mainconfig.reject_delay, Stringify(0) },
+ { "max_attributes", PW_TYPE_INTEGER, 0, &fr_max_attributes, STRINGIFY(0) },
+ { "reject_delay", PW_TYPE_INTEGER, 0, &mainconfig.reject_delay, STRINGIFY(0) },
{ "status_server", PW_TYPE_BOOLEAN, 0, &mainconfig.status_server, "no"},
{ NULL, -1, 0, NULL, NULL }
};
*/
static const CONF_PARSER logdest_config[] = {
{ "destination", PW_TYPE_STRING_PTR, 0, &radlog_dest, "files" },
- { "syslog_facility", PW_TYPE_STRING_PTR, 0, &syslog_facility, Stringify(0) },
+ { "syslog_facility", PW_TYPE_STRING_PTR, 0, &syslog_facility, STRINGIFY(0) },
{ "file", PW_TYPE_STRING_PTR, 0, &mainconfig.log_file, "${logdir}/radius.log" },
{ "requests", PW_TYPE_STRING_PTR, 0, &default_log.file, NULL },
{ "libdir", PW_TYPE_STRING_PTR, 0, &radlib_dir, "${prefix}/lib"},
{ "radacctdir", PW_TYPE_STRING_PTR, 0, &radacct_dir, "${logdir}/radacct" },
{ "hostname_lookups", PW_TYPE_BOOLEAN, 0, &fr_dns_lookups, "no" },
- { "max_request_time", PW_TYPE_INTEGER, 0, &mainconfig.max_request_time, Stringify(MAX_REQUEST_TIME) },
- { "cleanup_delay", PW_TYPE_INTEGER, 0, &mainconfig.cleanup_delay, Stringify(CLEANUP_DELAY) },
- { "max_requests", PW_TYPE_INTEGER, 0, &mainconfig.max_requests, Stringify(MAX_REQUESTS) },
+ { "max_request_time", PW_TYPE_INTEGER, 0, &mainconfig.max_request_time, STRINGIFY(MAX_REQUEST_TIME) },
+ { "cleanup_delay", PW_TYPE_INTEGER, 0, &mainconfig.cleanup_delay, STRINGIFY(CLEANUP_DELAY) },
+ { "max_requests", PW_TYPE_INTEGER, 0, &mainconfig.max_requests, STRINGIFY(MAX_REQUESTS) },
#ifdef DELETE_BLOCKED_REQUESTS
- { "delete_blocked_requests", PW_TYPE_INTEGER, 0, &mainconfig.kill_unresponsive_children, Stringify(false) },
+ { "delete_blocked_requests", PW_TYPE_INTEGER, 0, &mainconfig.kill_unresponsive_children, STRINGIFY(false) },
#endif
{ "pidfile", PW_TYPE_STRING_PTR, 0, &mainconfig.pid_file, "${run_dir}/radiusd.pid"},
{ "checkrad", PW_TYPE_STRING_PTR, 0, &mainconfig.checkrad, "${sbindir}/checkrad" },
static const CONF_PARSER proxy_config[] = {
{ "retry_delay", PW_TYPE_INTEGER,
offsetof(realm_config_t, retry_delay),
- NULL, Stringify(RETRY_DELAY) },
+ NULL, STRINGIFY(RETRY_DELAY) },
{ "retry_count", PW_TYPE_INTEGER,
offsetof(realm_config_t, retry_count),
- NULL, Stringify(RETRY_COUNT) },
+ NULL, STRINGIFY(RETRY_COUNT) },
{ "default_fallback", PW_TYPE_BOOLEAN,
offsetof(realm_config_t, fallback),
{ "dead_time", PW_TYPE_INTEGER,
offsetof(realm_config_t, dead_time),
- NULL, Stringify(DEAD_TIME) },
+ NULL, STRINGIFY(DEAD_TIME) },
{ "wake_all_if_all_dead", PW_TYPE_BOOLEAN,
offsetof(realm_config_t, wake_all_if_all_dead),
#ifdef WITH_COA
static CONF_PARSER home_server_coa[] = {
{ "irt", PW_TYPE_INTEGER,
- offsetof(home_server, coa_irt), 0, Stringify(2) },
+ offsetof(home_server, coa_irt), 0, STRINGIFY(2) },
{ "mrt", PW_TYPE_INTEGER,
- offsetof(home_server, coa_mrt), 0, Stringify(16) },
+ offsetof(home_server, coa_mrt), 0, STRINGIFY(16) },
{ "mrc", PW_TYPE_INTEGER,
- offsetof(home_server, coa_mrc), 0, Stringify(5) },
+ offsetof(home_server, coa_mrc), 0, STRINGIFY(5) },
{ "mrd", PW_TYPE_INTEGER,
- offsetof(home_server, coa_mrd), 0, Stringify(30) },
+ offsetof(home_server, coa_mrd), 0, STRINGIFY(30) },
{ NULL, -1, 0, NULL, NULL } /* end the list */
};
}
#endif
-#define XLAT_REGISTER(_x) xlat_register(Stringify(_x), xlat_ ## _x, NULL, NULL); \
- c = xlat_find(Stringify(_x)); \
+#define XLAT_REGISTER(_x) xlat_register(STRINGIFY(_x), xlat_ ## _x, NULL, NULL); \
+ c = xlat_find(STRINGIFY(_x)); \
rad_assert(c != NULL); \
c->internal = true
/*
* A mapping of configuration file names to internal variables.
*/
-#define RLM_PERL_CONF(_x) { "func_" Stringify(_x), PW_TYPE_STRING_PTR, \
- offsetof(rlm_perl_t,func_##_x), NULL, Stringify(_x)}
+#define RLM_PERL_CONF(_x) { "func_" STRINGIFY(_x), PW_TYPE_STRING_PTR, \
+ offsetof(rlm_perl_t,func_##_x), NULL, STRINGIFY(_x)}
static const CONF_PARSER module_config[] = {
{ "module", PW_TYPE_FILE_INPUT | PW_TYPE_DEPRECATED,