Replaced #if HAVE_X with #ifdef HAVE_X as the former test is troublemaker with #define HAVE_X where #define HAVE_X 1|0 is meant.

This commit is contained in:
Mateusz Loskot
2012-05-21 23:22:36 +01:00
parent 1abaaee658
commit a6f39a3c0c
5 changed files with 33 additions and 14 deletions

View File

@@ -20,19 +20,19 @@
#include <errno.h>
#include <ctype.h>
#if HAVE_SYS_TYPES_H
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#if HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
#if HAVE_FCNTL_H
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#if HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -42,10 +42,16 @@
# include <io.h>
#endif /* defined(WIN32) */
#if !HAVE_OPEN && defined(WIN32)
#if !defined(HAVE_OPEN) && defined(WIN32)
# define open _open
#endif
#if !defined(HAVE_SNPRINTF) && defined(_MSC_VER)
/* MSC has the version as _snprintf */
# define snprintf _snprintf
#elif !defined(HAVE_SNPRINTF)
# error You do not have snprintf on your system.
#endif /* HAVE_SNPRINTF */
#include "bits.h"
#include "debug.h"
@@ -204,7 +210,7 @@ int json_parse_int64(const char *buf, int64_t *retval)
return 0;
}
#if HAVE_REALLOC == 0
#ifndef HAVE_REALLOC
void* rpl_realloc(void* p, size_t n)
{
if (n == 0)