Skip to content

Commit

Permalink
config: prefix all HAVE_* and ENABLE_* defines with SYSLOG_NG_ prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
  • Loading branch information
ihrwein committed Nov 12, 2015
1 parent 857960f commit 5463fd1
Show file tree
Hide file tree
Showing 79 changed files with 154 additions and 154 deletions.
2 changes: 1 addition & 1 deletion lib/block-ref-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CfgLexerKeyword *block_def_keywords = block_ref_keywords;

CfgParser block_ref_parser =
{
#if ENABLE_DEBUG
#if SYSLOG_NG_ENABLE_DEBUG
.debug_flag = &block_ref_debug,
#endif
.name = "block reference",
Expand Down
4 changes: 2 additions & 2 deletions lib/cfg-lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ __glob_pattern_p (const char *pattern)
return 0;
}
#else
#define HAVE_GLOB_NOMAGIC 1
#define SYSLOG_NG_HAVE_GLOB_NOMAGIC 1
#endif

static gboolean
Expand Down Expand Up @@ -507,7 +507,7 @@ cfg_lexer_include_file_glob_at(CfgLexer *self, const gchar *pattern)
globfree(&globbuf);
if (r == GLOB_NOMATCH)
{
#ifndef HAVE_GLOB_NOMAGIC
#ifndef SYSLOG_NG_HAVE_GLOB_NOMAGIC
if (!__glob_pattern_p (pattern))
{
self->include_depth++;
Expand Down
2 changes: 1 addition & 1 deletion lib/cfg-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static CfgLexerKeyword main_keywords[] = {

CfgParser main_parser =
{
#if ENABLE_DEBUG
#if SYSLOG_NG_ENABLE_DEBUG
.debug_flag = &main_debug,
#endif
.name = "config",
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@
#ifndef COMPAT_COMPAT_H_INCLUDED
#define COMPAT_COMPAT_H_INCLUDED

#include <config.h>
#include <syslog-ng-config.h>

#endif
2 changes: 1 addition & 1 deletion lib/compat/getutent.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <fcntl.h>
#include <unistd.h>

#if !defined(HAVE_GETUTENT) && !defined(HAVE_GETUTXENT) && defined(HAVE_UTMP_H)
#if !defined(SYSLOG_NG_HAVE_GETUTENT) && !defined(SYSLOG_NG_HAVE_GETUTXENT) && defined(SYSLOG_NG_HAVE_UTMP_H)

static int utent_fd = -1;

Expand Down
4 changes: 2 additions & 2 deletions lib/compat/getutent.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
#include <inttypes.h>
#include <time.h>

#ifdef HAVE_UTMPX_H
#ifdef SYSLOG_NG_HAVE_UTMPX_H
#include <utmpx.h>
#else
#include <utmp.h>
#endif

#if !defined(HAVE_GETUTENT) && !defined(HAVE_GETUTXENT)
#if !defined(SYSLOG_NG_HAVE_GETUTENT) && !defined(SYSLOG_NG_HAVE_GETUTXENT)
struct utmp *getutent(void);
void endutent(void);
#endif
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/glib.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <glib.h>

#if !HAVE_G_MAPPED_FILE_UNREF
#if !SYSLOG_NG_HAVE_G_MAPPED_FILE_UNREF
#define g_mapped_file_unref g_mapped_file_free
#endif

Expand Down
2 changes: 1 addition & 1 deletion lib/compat/inet_aton.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
#include "compat/socket.h"

#ifndef HAVE_INET_ATON
#ifndef SYSLOG_NG_HAVE_INET_ATON
int
inet_aton(const char *cp, struct in_addr *dst)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/lfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "compat/compat.h"

#ifndef HAVE_O_LARGEFILE
#ifndef SYSLOG_NG_HAVE_O_LARGEFILE
#define O_LARGEFILE 0
#endif

Expand Down
2 changes: 1 addition & 1 deletion lib/compat/memrchr.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "compat/string.h"

#ifndef HAVE_MEMRCHR
#ifndef SYSLOG_NG_HAVE_MEMRCHR

#include <stdint.h>

Expand Down
2 changes: 1 addition & 1 deletion lib/compat/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "compat/pio.h"

#if !HAVE_PREAD || HAVE_BROKEN_PREAD
#if !SYSLOG_NG_HAVE_PREAD || SYSLOG_NG_HAVE_BROKEN_PREAD

#include <sys/types.h>
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/compat/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/* NOTE: bb__ prefix is used for function names that might clash with system
* supplied symbols. */

#if !HAVE_PREAD || HAVE_BROKEN_PREAD
#if !SYSLOG_NG_HAVE_PREAD || SYSLOG_NG_HAVE_BROKEN_PREAD
# ifdef pread
# undef pread
# endif
Expand Down
6 changes: 3 additions & 3 deletions lib/compat/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <netdb.h>
#include <netinet/in.h>

#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
#ifndef SYSLOG_NG_HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage
{
union
Expand All @@ -40,14 +40,14 @@ struct sockaddr_storage
struct sockaddr __sa;
struct sockaddr_un __sun;
struct sockaddr_in __sin;
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
struct sockaddr_in6 __sin6;
#endif
};
};
#endif

#ifndef HAVE_INET_ATON
#ifndef SYSLOG_NG_HAVE_INET_ATON
int inet_aton(const char *cp, struct in_addr *dst);
#endif

Expand Down
2 changes: 1 addition & 1 deletion lib/compat/strcasestr.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "compat/string.h"

#ifndef HAVE_STRCASESTR
#ifndef SYSLOG_NG_HAVE_STRCASESTR

#include <ctype.h>
#include <string.h>
Expand Down
10 changes: 5 additions & 5 deletions lib/compat/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "compat.h"
#include <string.h>

#if !HAVE_STRTOLL
# if HAVE_STRTOIMAX || defined(strtoimax)
#if !SYSLOG_NG_HAVE_STRTOLL
# if SYSLOG_NG_HAVE_STRTOIMAX || defined(strtoimax)
/* HP-UX has an strtoimax macro, not a function */
#define strtoll(nptr, endptr, base) strtoimax(nptr, endptr, base)
# else
Expand All @@ -36,15 +36,15 @@
# endif
#endif

#if !HAVE_STRCASESTR
#if !SYSLOG_NG_HAVE_STRCASESTR
char *strcasestr(const char *s, const char *find);
#endif

#if !HAVE_MEMRCHR
#if !SYSLOG_NG_HAVE_MEMRCHR
void *memrchr(const void *s, int c, size_t n);
#endif

#ifndef HAVE_STRTOK_R
#ifndef SYSLOG_NG_HAVE_STRTOK_R
char *strtok_r(char *string, const char *delim, char **saveptr);
#endif
#endif
2 changes: 1 addition & 1 deletion lib/compat/strtok_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
#include "compat/string.h"

#if !defined(HAVE_STRTOK_R) || TEST_STRTOK_R
#if !defined(SYSLOG_NG_HAVE_STRTOK_R) || TEST_STRTOK_R

char *
strtok_r(char *str, const char *delim, char **saveptr)
Expand Down
12 changes: 6 additions & 6 deletions lib/dnscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct _DNSCacheKey
union
{
struct in_addr ip;
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
struct in6_addr ip6;
#endif
} addr;
Expand Down Expand Up @@ -97,7 +97,7 @@ dns_cache_key_equal(DNSCacheKey *e1, DNSCacheKey *e2)
{
if ((e1->family == AF_INET && memcmp(&e1->addr.ip, &e2->addr.ip, sizeof(e1->addr.ip)) == 0))
return TRUE;
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
if ((e1->family == AF_INET6 && memcmp(&e1->addr.ip6, &e2->addr.ip6, sizeof(e1->addr.ip6)) == 0))
return TRUE;
#endif
Expand All @@ -112,7 +112,7 @@ dns_cache_key_hash(DNSCacheKey *e)
{
return ntohl(e->addr.ip.s_addr);
}
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
else if (e->family == AF_INET6)
{
guint32 *a32 = (guint32 *) &e->addr.ip6.s6_addr;
Expand Down Expand Up @@ -154,7 +154,7 @@ dns_cache_fill_key(DNSCacheKey *key, gint family, void *addr)
case AF_INET:
key->addr.ip = *(struct in_addr *) addr;
break;
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
case AF_INET6:
key->addr.ip6 = *(struct in6_addr *) addr;
break;
Expand Down Expand Up @@ -210,7 +210,7 @@ dns_cache_check_hosts(glong t)
union
{
struct in_addr ip4;
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
struct in6_addr ip6;
#endif
} ia;
Expand All @@ -227,7 +227,7 @@ dns_cache_check_hosts(glong t)
continue;
ip = p;

#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
if (strchr(ip, ':') != NULL)
family = AF_INET6;
else
Expand Down
2 changes: 1 addition & 1 deletion lib/filter/filter-expr-grammar.ym
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ filter_simple_expr
| KW_FILTER '(' string ')' { $$ = filter_call_new($3, configuration); free($3); }
| KW_NETMASK '(' string ')' { $$ = filter_netmask_new($3); free($3); }
| KW_NETMASK6 '(' string ')' {
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
$$ = filter_netmask6_new($3);
#else
YYERROR;
Expand Down
4 changes: 2 additions & 2 deletions lib/filter/filter-expr-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static CfgLexerKeyword filter_expr_keywords[] = {
{ "netmask", KW_NETMASK },
{ "tags", KW_TAGS, 0x0301 },
{ "in_list", KW_IN_LIST, 0x0305 },
#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
{ "netmask6", KW_NETMASK6 },
#endif

Expand All @@ -69,7 +69,7 @@ static CfgLexerKeyword filter_expr_keywords[] = {

CfgParser filter_expr_parser =
{
#if ENABLE_DEBUG
#if SYSLOG_NG_ENABLE_DEBUG
.debug_flag = &filter_expr_debug,
#endif
.name = "filter expression",
Expand Down
2 changes: 1 addition & 1 deletion lib/filter/filter-netmask6.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>

#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
typedef struct _FilterNetmask6
{
FilterExprNode super;
Expand Down
2 changes: 1 addition & 1 deletion lib/filter/tests/test_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ main(int argc G_GNUC_UNUSED, char *argv[] G_GNUC_UNUSED)

TEST_ASSERT(create_posix_regexp_match("((", 0) == NULL);

#if ENABLE_IPV6
#if SYSLOG_NG_ENABLE_IPV6
sender_saddr = g_sockaddr_inet6_new("2001:db80:85a3:8d30:1319:8a2e:3700:7348", 5000);
testcase("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized", filter_netmask6_new("::/1"), 1);
testcase("<15>Oct 15 16:17:01 host openvpn[2499]: PTHREAD support initialized", filter_netmask6_new("2001:db80:85a3:8d30:1319:8a2e::/95"), 1);
Expand Down
18 changes: 9 additions & 9 deletions lib/gprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <pwd.h>
#include <grp.h>

#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS
# include <sys/capability.h>
# include <sys/prctl.h>
#endif
Expand Down Expand Up @@ -99,7 +99,7 @@ static gint startup_result_pipe[2] = { -1, -1 };
static gint init_result_pipe[2] = { -1, -1 };
static GProcessKind process_kind = G_PK_STARTUP;
static gboolean stderr_present = TRUE;
#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS
static int have_capsyslog = FALSE;
#endif

Expand Down Expand Up @@ -140,7 +140,7 @@ static struct
.gid = -1
};

#if ENABLE_SYSTEMD
#if SYSLOG_NG_ENABLE_SYSTEMD
/**
* Inherits systemd socket activation from parent process updating the pid
* in LISTEN_PID to the pid of the child process.
Expand Down Expand Up @@ -196,7 +196,7 @@ inherit_systemd_activation(void)

#endif

#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS

/**
* g_process_cap_modify:
Expand Down Expand Up @@ -493,7 +493,7 @@ g_process_set_caps(const gchar *caps)
void
g_process_set_argv_space(gint argc, gchar **argv)
{
#ifdef HAVE_ENVIRON
#ifdef SYSLOG_NG_HAVE_ENVIRON
extern char **environ;
gchar *lastargv = NULL;
gchar **envp = environ;
Expand Down Expand Up @@ -678,7 +678,7 @@ g_process_enable_core(void)

if (process_opts.core)
{
#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS
if (!prctl(PR_GET_DUMPABLE, 0, 0, 0, 0))
{
gint rc;
Expand Down Expand Up @@ -811,7 +811,7 @@ g_process_change_root(void)
static gboolean
g_process_change_user(void)
{
#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS
if (process_opts.caps)
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
#endif
Expand Down Expand Up @@ -845,7 +845,7 @@ g_process_change_user(void)
return TRUE;
}

#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS
/**
* g_process_change_caps:
*
Expand Down Expand Up @@ -1044,7 +1044,7 @@ g_process_perform_startup(void)
static void
g_process_setproctitle(const gchar* proc_title)
{
#ifdef HAVE_ENVIRON
#ifdef SYSLOG_NG_HAVE_ENVIRON
size_t len;

g_assert(process_opts.argv_start != NULL);
Expand Down
4 changes: 2 additions & 2 deletions lib/gprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <sys/types.h>

#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS
# include <sys/capability.h>
#endif

Expand All @@ -40,7 +40,7 @@ typedef enum
G_PM_SAFE_BACKGROUND,
} GProcessMode;

#if ENABLE_LINUX_CAPS
#if SYSLOG_NG_ENABLE_LINUX_CAPS

gboolean g_process_cap_modify(int capability, int onoff);
cap_t g_process_cap_save(void);
Expand Down
Loading

0 comments on commit 5463fd1

Please sign in to comment.