[Ttssh2-commit] [8959] cJSON.c を VS2005 でビルドできるよう修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 10月 18日 (日) 00:55:59 JST


Revision: 8959
          https://osdn.net/projects/ttssh2/scm/svn/commits/8959
Author:   zmatsuo
Date:     2020-10-18 00:55:59 +0900 (Sun, 18 Oct 2020)
Log Message:
-----------
cJSON.c を VS2005 でビルドできるよう修正

- NAN の扱いで VS2005 でエラーが出る
- とりあえず 0 を返すようにしてエラーを回避

Modified Paths:
--------------
    trunk/TTXSamples/TTXCheckUpdate/CMakeLists.txt
    trunk/TTXSamples/TTXCheckUpdate/TTXCheckUpdate.v8.vcproj

-------------- next part --------------
Modified: trunk/TTXSamples/TTXCheckUpdate/CMakeLists.txt
===================================================================
--- trunk/TTXSamples/TTXCheckUpdate/CMakeLists.txt	2020-10-17 15:55:45 UTC (rev 8958)
+++ trunk/TTXSamples/TTXCheckUpdate/CMakeLists.txt	2020-10-17 15:55:59 UTC (rev 8959)
@@ -39,8 +39,18 @@
 target_compile_definitions(
   TTXCheckUpdate
   PRIVATE
-  -D CJSON_HIDE_SYMBOLS)
+  -D CJSON_HIDE_SYMBOLS
+  )
 
+if(MSVC_VERSION STREQUAL 1400)
+  # VS2005 special define
+  set_source_files_properties(
+    ../../libs/cJSON/cJSON.c
+    PROPERTIES
+    COMPILE_FLAGS "-D NAN=0"
+    )
+endif()
+
 target_include_directories(
   TTXCheckUpdate
   PRIVATE

Modified: trunk/TTXSamples/TTXCheckUpdate/TTXCheckUpdate.v8.vcproj
===================================================================
--- trunk/TTXSamples/TTXCheckUpdate/TTXCheckUpdate.v8.vcproj	2020-10-17 15:55:45 UTC (rev 8958)
+++ trunk/TTXSamples/TTXCheckUpdate/TTXCheckUpdate.v8.vcproj	2020-10-17 15:55:59 UTC (rev 8959)
@@ -195,6 +195,22 @@
 			<File
 				RelativePath="..\..\libs\cJSON\cJSON.c"
 				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="CJSON_HIDE_SYMBOLS;NAN=0"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="CJSON_HIDE_SYMBOLS;NAN=0"
+					/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\libs\cJSON\cJSON.h"


Ttssh2-commit メーリングリストの案内
Back to archive index