@@ -97,22 +97,9 @@ More info: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run
97
97
98
98
99
99
# ---- definitions ----
100
- if (WIN32 OR WIN64 )
100
+ if (WIN32 )
101
101
add_definitions (-DUNICODE=1 )
102
102
add_definitions (-D_UNICODE=1 )
103
-
104
- if (WIN64 OR CMAKE_SIZEOF_VOID_P EQUAL 8 )
105
- message ("WIN 64" )
106
- add_definitions (-DWIN64=1 )
107
- add_definitions (-D_WIN64=1 )
108
- elseif (WIN32 OR CMAKE_SIZEOF_VOID_P EQUAL 4 )
109
- message ("WIN 32" )
110
- add_definitions (-DWIN32=1 )
111
- add_definitions (-D_WIN32=1 )
112
- else ()
113
- message ("WIN.. undefined" )
114
- endif ()
115
-
116
103
endif ()
117
104
118
105
if (MINGW )
@@ -284,27 +271,26 @@ endif()
284
271
285
272
# ---- check functions ----
286
273
if (MSVC )
287
- check_symbol_exists (_wfopen_s "stdio.h" HAVE__WFOPEN_S )
288
- if (NOT HAVE__WFOPEN_S )
289
- check_symbol_exists (_wfopen_s "wchar.h" HAVE__WFOPEN_S )
290
- endif ()
274
+ set (LIBPLZMA_CHECK_SYMBOL_HEADERS
275
+ stdio.h
276
+ stdlib.h
277
+ wchar.h
278
+ )
279
+ check_symbol_exists (_wfopen_s ${LIBPLZMA_CHECK_SYMBOL_HEADERS} HAVE__WFOPEN_S )
291
280
if (HAVE__WFOPEN_S )
292
281
add_definitions (-DHAVE__WFOPEN_S=1 )
293
282
endif ()
294
283
295
- check_symbol_exists (_wdupenv_s "stdlib.h" HAVE__WDUPENV_S )
296
- if (NOT HAVE__WDUPENV_S )
297
- check_symbol_exists (_wdupenv_s "wchar.h" HAVE__WDUPENV_S )
298
- endif ()
284
+ check_symbol_exists (_wdupenv_s ${LIBPLZMA_CHECK_SYMBOL_HEADERS} HAVE__WDUPENV_S )
299
285
if (HAVE__WDUPENV_S )
300
286
add_definitions (-DHAVE__WDUPENV_S=1 )
301
287
endif ()
302
288
303
- check_symbol_exists (_dupenv_s "stdlib.h" HAVE__DUPENV_S )
289
+ check_symbol_exists (_dupenv_s ${LIBPLZMA_CHECK_SYMBOL_HEADERS} HAVE__DUPENV_S )
304
290
if (HAVE__DUPENV_S )
305
291
add_definitions (-DHAVE__DUPENV_S=1 )
306
292
endif ()
307
- endif (MSVC )
293
+ endif ()
308
294
309
295
310
296
# ---- include ----
0 commit comments