]> granicus.if.org Git - json-c/commitdiff
Revert "compat/strdup.h: move common compat check for strdup() to own file"
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 7 Nov 2016 20:51:11 +0000 (20:51 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 7 Nov 2016 20:51:11 +0000 (20:51 +0000)
This reverts commit aaba8c1080533133329086e47f4f45981dfdd1ee.

This commit breaks builddir != srcdir build, but, more importantly, it
also adds a dependency on a header, "config.h", which is not installed
and it's supposed to be private — since it's generated at configuration
time and it's not meant to be used by projects compiling against a
library.

CMakeLists.txt
Makefile.am
compat/strdup.h [deleted file]
json-c.vcproj
json-c.vcxproj
json-c.vcxproj.filters
json_object.c
json_tokener.c

index 77a9558b4f80cb77d13344682bb1ff039f11bb00..6dd38adcc6e93c5d49dfa8f3c2e80e21b53c4046 100644 (file)
@@ -23,7 +23,6 @@ endif()
 include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
 
 set(JSON_C_HEADERS
-    ./compat/strdup.h
     ./json.h
     ${CMAKE_CURRENT_BINARY_DIR}/include/config.h
     ./json_config.h
index 58452fc2b1d27ed310326f84794fab4128592337..41b9e6e10bd64ea8f7e6a0d33512178cd92eb314 100644 (file)
@@ -18,7 +18,6 @@ libjson_cincludedir = $(includedir)/json-c
 libjson_cinclude_HEADERS = \
        arraylist.h \
        bits.h \
-       compat/strdup.h \
        debug.h \
        json.h \
        json_c_version.h \
diff --git a/compat/strdup.h b/compat/strdup.h
deleted file mode 100644 (file)
index 6b1a34c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __STRDUP_H_COMPAT__
-#define __STRDUP_H_COMPAT__
-
-#include "../config.h"
-
-#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 */
-
-#endif /* __STRDUP_H_COMPAT__ */
index 796856ea31fa7c533985239f39f20cbffcf043c4..93aaeb3861fc216723cc1cea02cd27a68ab03208 100644 (file)
@@ -134,9 +134,6 @@ copy json_config.h.win32 json_config.h"/>
                        <File
                                RelativePath=".\bits.h">
                        </File>
-                       <File
-                               RelativePath=".\compat\strdup.h">
-                       </File>
                        <File
                                RelativePath=".\debug.h">
                        </File>
index 02e0c2de48c525467d6b36d9c9bc33609a8f01f7..8a4f265ea137989e2b8760e6650f8ba73965bb05 100644 (file)
@@ -142,7 +142,6 @@ copy json_config.h.win32 json_config.h
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="arraylist.h" />
-    <ClInclude Include="compat\strdup.h" />
     <ClInclude Include="debug.h" />
     <ClInclude Include="json_inttypes.h" />
     <ClInclude Include="json_object.h" />
@@ -165,4 +164,4 @@ copy json_config.h.win32 json_config.h
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
index cc133558823502de19ba15f9c6e0fb3ac859225c..67ff360065a20f9b4a878cd6ca303e43b260c49e 100644 (file)
@@ -50,9 +50,6 @@
     <ClInclude Include="arraylist.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="compat\strdup.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="debug.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -96,4 +93,4 @@
     <None Include="README-WIN32.html" />
     <None Include="README.html" />
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index 17fdd34830ce5bf93b8fa2d858b550365f7d8929..8a70b5d28077ec5a21c6553bf72a76afa1a45950 100644 (file)
 #include "json_object_private.h"
 #include "json_util.h"
 #include "math_compat.h"
-#include "compat/strdup.h"
+
+#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_SNPRINTF) && defined(_MSC_VER)
   /* MSC has the version as _snprintf */
index 4521ef9a303837d57d5420c0f839da97c72fe58e..65652f421fff3cca5cc23aa7a9fd25a43a40a6e0 100644 (file)
@@ -31,7 +31,6 @@
 #include "json_object.h"
 #include "json_tokener.h"
 #include "json_util.h"
-#include "compat/strdup.h"
 
 #ifdef HAVE_LOCALE_H
 #include <locale.h>
 
 #define jt_hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)
 
+#if !HAVE_STRDUP && defined(_MSC_VER)
+  /* MSC has the version as _strdup */
+# define strdup _strdup
+#elif !HAVE_STRDUP
+# error You do not have strdup on your system.
+#endif /* HAVE_STRDUP */
+
 #if !HAVE_STRNCASECMP && defined(_MSC_VER)
   /* MSC has the version as _strnicmp */
 # define strncasecmp _strnicmp