Browse Source

Merge pull request #285 from ebassi/revert-strdup-compat

Revert "compat/strdup.h: move common compat check for strdup() to own…
tags/json-c-0.13-20171207
Eric Haszlakiewicz GitHub 9 years ago
parent
commit
8e12f4a21c
8 changed files with 16 additions and 26 deletions
  1. +0
    -1
      CMakeLists.txt
  2. +0
    -1
      Makefile.am
  3. +0
    -13
      compat/strdup.h
  4. +0
    -3
      json-c.vcproj
  5. +1
    -2
      json-c.vcxproj
  6. +1
    -4
      json-c.vcxproj.filters
  7. +7
    -1
      json_object.c
  8. +7
    -1
      json_tokener.c

+ 0
- 1
CMakeLists.txt View 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


+ 0
- 1
Makefile.am View 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 \


+ 0
- 13
compat/strdup.h View File

@@ -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__ */

+ 0
- 3
json-c.vcproj View 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>


+ 1
- 2
json-c.vcxproj View 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>

+ 1
- 4
json-c.vcxproj.filters View 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>

+ 7
- 1
json_object.c View File

@@ -29,7 +29,13 @@
#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 */


+ 7
- 1
json_tokener.c View 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>
@@ -42,6 +41,13 @@

#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


Loading…
Cancel
Save