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

@@ -26,7 +26,14 @@
#include "json_object_private.h"
#include "json_util.h"
#if !HAVE_STRNDUP
#if !defined(HAVE_STRDUP) && defined(_MSC_VER)
/* MSC has the version as _strdup */
# define strdup _strdup
#elif !defined(HAVE_STRDUP)
# error You do not have strdup on your system.
#endif /* HAVE_STRDUP */
#if !defined(HAVE_STRNDUP)
char* strndup(const char* str, size_t n);
#endif /* !HAVE_STRNDUP */