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.
diff --git a/json_object.c b/json_object.c
index 5a35938..8e399de 100644
--- a/json_object.c
+++ b/json_object.c
@@ -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 */