redmine

Headers polishing

... ... @@ -87,65 +87,7 @@
# define IN_CREATE_SELF IN_CREATE
#endif
#ifdef _DEBUG
# define DEBUGV(...) __VA_ARGS__
#else
# define DEBUGV(...)
#endif
#ifdef PARANOID
# define PARANOIDV(...) __VA_ARGS__
#else
# define PARANOIDV(...)
#endif
#ifdef _GNU_SOURCE
# ifndef likely
# define likely(x) __builtin_expect(!!(x), 1)
# endif
# ifndef unlikely
# define unlikely(x) __builtin_expect(!!(x), 0)
# endif
#else
# ifndef likely
# define likely(x) (x)
# endif
# ifndef unlikely
# define unlikely(x) (x)
# endif
#endif
#ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
#endif
// clang defines "__GNUC__", but not compatible with gnuc. Fixing.
#ifdef __clang__
# ifdef __GNUC__
# undef __GNUC__
# endif
#endif
#define TOSTR(a) # a
#define XTOSTR(a) TOSTR(a)
#define COLLECTDELAY_INSTANT ((unsigned int)~0)
#define MSG_SECURITY_PROBLEM(a) "Security problem: "a". Don't use this application until the bug will be fixed. Report about the problem to: "AUTHOR
#define require_strlen_le(str, limit) \
if (strlen(str) >= limit)\
critical("length of "TOSTR(str)" (\"%s\") >= "TOSTR(limit));\
#define SAFE(code, onfail) ({\
long _SAFE_rc;\
if ((_SAFE_rc = code)) {\
error("Got error while "TOSTR(code));\
onfail;\
} \
_SAFE_rc;\
})
#include "macros.h"
enum paramsource_enum {
PS_UNKNOWN = 0,
... ...
... ... @@ -36,7 +36,8 @@
#define MAXMOUNTPOINTS (1<<8)
#define MAXPERMITTEDHOOKFILES (1<<8)
#ifdef __CLSYNC_COMMON_H
#ifndef PIC
# ifdef __CLSYNC_COMMON_H
# ifndef DEFAULT_NOTIFYENGINE
# ifdef __linux__
# ifdef INOTIFY_SUPPORT
... ... @@ -75,6 +76,7 @@
# error No monitor subsystem supported
# define DEFAULT_NOTIFYENGINE NE_UNDEFINED
# endif
# endif
#endif
#define DEFAULT_RULES_PERM RA_ALL
... ...
... ... @@ -65,7 +65,7 @@ AS_IF([test "x$enable_cluster" = "xyes"], [CPPFLAGS="${CPPFLAGS} -DCLUSTER_SUPPO
AS_IF([test "x$with_mhash" = "xno"], [], [
AC_CHECK_HEADER([mhash.h], [], [AC_MSG_ERROR("Unable to find mhash.h")])
AC_SEARCH_LIBS([mhash_init], [mhash], [CPPFLAGS="${CPPFLAGS} -DHAVE_MHASH"],
AC_SEARCH_LIBS([mhash_init], [mhash], [CPPFLAGS="${CPPFLAGS} -DHAVE_MHASH"; LDFLAGS="${LDFLAGS} -lmhash"],
[AC_MSG_ERROR("Unable to find libmhash")])
])
])
... ...
... ... @@ -22,8 +22,6 @@
* to be slow but convenient functions.
*/
#include "common.h"
#include <stdlib.h>
#include <execinfo.h>
#include <stdio.h>
... ... @@ -32,6 +30,12 @@
#include <stdarg.h>
#include <syslog.h>
#include <pthread.h> /* pthread_self() */
#include <sys/types.h> /* getpid() */
#include <unistd.h> /* getpid() */
#include "configuration.h"
#include "error.h"
#include "pthreadex.h" /* pthread_*_shared() */
... ...
... ... @@ -18,7 +18,6 @@
*/
#define LIBCLSYNC
#include "common.h"
#include <errno.h>
#include <stdlib.h>
... ...
#ifndef __CLSYNC_MACROS_H
#define __CLSYNC_MACROS_H
#ifdef _DEBUG
# define DEBUGV(...) __VA_ARGS__
#else
# define DEBUGV(...)
#endif
#ifdef PARANOID
# define PARANOIDV(...) __VA_ARGS__
#else
# define PARANOIDV(...)
#endif
#ifdef _GNU_SOURCE
# ifndef likely
# define likely(x) __builtin_expect(!!(x), 1)
# endif
# ifndef unlikely
# define unlikely(x) __builtin_expect(!!(x), 0)
# endif
#else
# ifndef likely
# define likely(x) (x)
# endif
# ifndef unlikely
# define unlikely(x) (x)
# endif
#endif
#ifndef offsetof
# define offsetof(a, b) __builtin_offsetof(a, b)
#endif
// clang defines "__GNUC__", but not compatible with gnuc. Fixing.
#ifdef __clang__
# ifdef __GNUC__
# undef __GNUC__
# endif
#endif
#define TOSTR(a) # a
#define XTOSTR(a) TOSTR(a)
#define COLLECTDELAY_INSTANT ((unsigned int)~0)
#define MSG_SECURITY_PROBLEM(a) "Security problem: "a". Don't use this application until the bug will be fixed. Report about the problem to: "AUTHOR
#define require_strlen_le(str, limit) \
if (strlen(str) >= limit)\
critical("length of "TOSTR(str)" (\"%s\") >= "TOSTR(limit));\
#define SAFE(code, onfail) ({\
long _SAFE_rc;\
if ((_SAFE_rc = code)) {\
error("Got error while "TOSTR(code));\
onfail;\
} \
_SAFE_rc;\
})
#endif
... ...
... ... @@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
#include "macros.h"
#include <stdlib.h>
#include <string.h>
... ...
... ... @@ -17,8 +17,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
... ...