From b13e568d9916e1da995d269469de68fb76651b6a Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 18 May 2024 13:21:47 +0300 Subject: [PATCH] [CMAKE] Remove global _CRT_NON_CONFORMING_SWPRINTFS Instead define it only in 3rd-party code where required. Most of these will go away with future wine-syncs. --- CMakeLists.txt | 2 -- base/applications/cmdutils/reg/CMakeLists.txt | 1 + base/applications/mstsc/CMakeLists.txt | 1 + base/applications/network/route/CMakeLists.txt | 1 + base/applications/regedit/CMakeLists.txt | 1 + base/system/chkdsk/CMakeLists.txt | 1 + dll/directx/dsound_new/CMakeLists.txt | 1 + dll/directx/wine/dxdiagn/CMakeLists.txt | 1 + dll/shellext/shellbtrfs/CMakeLists.txt | 2 ++ dll/win32/atl/CMakeLists.txt | 1 + dll/win32/comdlg32/CMakeLists.txt | 1 + dll/win32/credui/CMakeLists.txt | 1 + dll/win32/cryptdlg/CMakeLists.txt | 1 + dll/win32/cryptui/CMakeLists.txt | 1 + dll/win32/dbghelp/CMakeLists.txt | 3 ++- dll/win32/fusion/CMakeLists.txt | 1 + dll/win32/ieframe/CMakeLists.txt | 1 + dll/win32/itss/CMakeLists.txt | 2 +- dll/win32/jscript/CMakeLists.txt | 2 ++ dll/win32/jsproxy/CMakeLists.txt | 1 + dll/win32/mlang/CMakeLists.txt | 2 +- dll/win32/mpr/CMakeLists.txt | 1 + dll/win32/msacm32/CMakeLists.txt | 1 + dll/win32/oleacc/CMakeLists.txt | 1 + dll/win32/oleaut32/CMakeLists.txt | 3 ++- dll/win32/pdh/CMakeLists.txt | 1 + dll/win32/powrprof/CMakeLists.txt | 1 + dll/win32/rpcrt4/CMakeLists.txt | 1 + dll/win32/scrrun/CMakeLists.txt | 1 + dll/win32/shell32/CMakeLists.txt | 9 +++++++-- dll/win32/sti/CMakeLists.txt | 1 + dll/win32/sxs/CMakeLists.txt | 1 + dll/win32/tapi32/CMakeLists.txt | 1 + dll/win32/urlmon/CMakeLists.txt | 1 + dll/win32/usp10/CMakeLists.txt | 1 + dll/win32/wbemprox/CMakeLists.txt | 1 + dll/win32/wmiutils/CMakeLists.txt | 1 + dll/win32/wshom.ocx/CMakeLists.txt | 1 + dll/win32/xmllite/CMakeLists.txt | 1 + drivers/filesystems/ext2/CMakeLists.txt | 2 ++ drivers/filesystems/udfs/CMakeLists.txt | 2 ++ drivers/storage/ide/uniata/CMakeLists.txt | 1 + 42 files changed, 53 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6340581675..3cab38ca9eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,8 +73,6 @@ include(sdk/cmake/set_wine_module.cmake) add_definitions( -D__REACTOS__ - # swprintf without count argument is used in most of the codebase - -D_CRT_NON_CONFORMING_SWPRINTFS ) # There doesn't seem to be a standard for __FILE__ being relative or absolute, so detect it at runtime. diff --git a/base/applications/cmdutils/reg/CMakeLists.txt b/base/applications/cmdutils/reg/CMakeLists.txt index d8cce2676d2..3fb819e7bfb 100644 --- a/base/applications/cmdutils/reg/CMakeLists.txt +++ b/base/applications/cmdutils/reg/CMakeLists.txt @@ -4,6 +4,7 @@ add_definitions(-D_WIN32_WINNT=0x600) add_executable(reg add.c copy.c delete.c export.c import.c query.c reg.c reg.rc) set_module_type(reg win32cui UNICODE) +target_compile_definitions(reg PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(reg wine oldnames) add_importlibs(reg advapi32 advapi32_vista user32 msvcrt kernel32 ntdll) add_cd_file(TARGET reg DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mstsc/CMakeLists.txt b/base/applications/mstsc/CMakeLists.txt index 6cede16d5f5..10bc6a4493c 100644 --- a/base/applications/mstsc/CMakeLists.txt +++ b/base/applications/mstsc/CMakeLists.txt @@ -35,6 +35,7 @@ file(GLOB mstsc_rc_deps res/*.*) add_rc_deps(rdc.rc ${mstsc_rc_deps}) add_executable(mstsc ${SOURCE} rdc.rc) set_module_type(mstsc win32gui UNICODE) +target_compile_definitions(mstsc PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) add_importlibs(mstsc user32 gdi32 comctl32 ws2_32 crypt32 secur32 advapi32 shell32 ole32 comdlg32 msvcrt kernel32) add_pch(mstsc precomp.h SOURCE) add_cd_file(TARGET mstsc DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/route/CMakeLists.txt b/base/applications/network/route/CMakeLists.txt index 69d894dfcb2..3f9469abd52 100644 --- a/base/applications/network/route/CMakeLists.txt +++ b/base/applications/network/route/CMakeLists.txt @@ -1,6 +1,7 @@ add_executable(route route.c route.rc) set_module_type(route win32cui UNICODE) +target_compile_definitions(route PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(route conutils) add_importlibs(route ws2_32 iphlpapi advapi32 msvcrt kernel32 ntdll) ## ntdll for RtlIpv* add_cd_file(TARGET route DESTINATION reactos/system32 FOR all) diff --git a/base/applications/regedit/CMakeLists.txt b/base/applications/regedit/CMakeLists.txt index a1d2ffc7349..f5e27429ad0 100644 --- a/base/applications/regedit/CMakeLists.txt +++ b/base/applications/regedit/CMakeLists.txt @@ -27,6 +27,7 @@ file(GLOB regedit_rc_deps res/*.*) add_rc_deps(regedit.rc ${regedit_rc_deps}) add_executable(regedit ${SOURCE} regedit.rc) set_module_type(regedit win32gui UNICODE) +target_compile_definitions(regedit PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(regedit uuid wine) add_importlibs(regedit user32 gdi32 advapi32 ole32 shell32 comctl32 comdlg32 shlwapi msvcrt kernel32 ntdll) add_pch(regedit regedit.h SOURCE) diff --git a/base/system/chkdsk/CMakeLists.txt b/base/system/chkdsk/CMakeLists.txt index 6de5d302d33..bf1ac9e0482 100644 --- a/base/system/chkdsk/CMakeLists.txt +++ b/base/system/chkdsk/CMakeLists.txt @@ -3,6 +3,7 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/fmifs) add_executable(chkdsk chkdsk.c chkdsk.rc) set_module_type(chkdsk win32cui UNICODE) +target_compile_definitions(chkdsk PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(chkdsk conutils) add_importlibs(chkdsk fmifs msvcrt kernel32) add_cd_file(TARGET chkdsk DESTINATION reactos/system32 FOR all) diff --git a/dll/directx/dsound_new/CMakeLists.txt b/dll/directx/dsound_new/CMakeLists.txt index eaff7964f1a..50da468c877 100644 --- a/dll/directx/dsound_new/CMakeLists.txt +++ b/dll/directx/dsound_new/CMakeLists.txt @@ -25,6 +25,7 @@ add_library(dsound MODULE ${CMAKE_CURRENT_BINARY_DIR}/dsound.def) set_module_type(dsound win32dll) +target_compile_definitions(dsound PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(dsound dxguid uuid) add_importlibs(dsound winmm ole32 advapi32 setupapi ksuser user32 msvcrt kernel32 ntdll) add_pch(dsound precomp.h SOURCE) diff --git a/dll/directx/wine/dxdiagn/CMakeLists.txt b/dll/directx/wine/dxdiagn/CMakeLists.txt index 22d94ccbefc..ab3055a2b03 100644 --- a/dll/directx/wine/dxdiagn/CMakeLists.txt +++ b/dll/directx/wine/dxdiagn/CMakeLists.txt @@ -16,6 +16,7 @@ add_library(dxdiagn MODULE ${CMAKE_CURRENT_BINARY_DIR}/dxdiagn.def) set_module_type(dxdiagn win32dll) +target_compile_definitions(dxdiagn PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(dxdiagn strmiids dxguid uuid wine) add_dependencies(dxdiagn wineheaders) add_importlibs(dxdiagn d3d9 ddraw version ole32 oleaut32 psapi user32 dsound msvcrt kernel32 ntdll) diff --git a/dll/shellext/shellbtrfs/CMakeLists.txt b/dll/shellext/shellbtrfs/CMakeLists.txt index 8fe8aa4d7ae..52ae2580252 100644 --- a/dll/shellext/shellbtrfs/CMakeLists.txt +++ b/dll/shellext/shellbtrfs/CMakeLists.txt @@ -37,6 +37,8 @@ add_library(shellbtrfs MODULE shellbtrfs.rc ${CMAKE_CURRENT_BINARY_DIR}/shellbtrfs.def) +target_compile_definitions(shellbtrfs PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) + file(GLOB shellbtrfs_rc_deps *.ico) add_rc_deps(shellbtrfs.rc ${shellbtrfs_rc_deps}) diff --git a/dll/win32/atl/CMakeLists.txt b/dll/win32/atl/CMakeLists.txt index b598826fdbd..b66c913b636 100644 --- a/dll/win32/atl/CMakeLists.txt +++ b/dll/win32/atl/CMakeLists.txt @@ -3,6 +3,7 @@ remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) add_definitions( + -D_CRT_NON_CONFORMING_SWPRINTFS -D_ATL_VER=_ATL_VER_30) spec2def(atl.dll atl.spec ADD_IMPORTLIB) diff --git a/dll/win32/comdlg32/CMakeLists.txt b/dll/win32/comdlg32/CMakeLists.txt index 8dd627dc91c..01764dac970 100644 --- a/dll/win32/comdlg32/CMakeLists.txt +++ b/dll/win32/comdlg32/CMakeLists.txt @@ -24,6 +24,7 @@ add_library(comdlg32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/comdlg32.def) set_module_type(comdlg32 win32dll) +target_compile_definitions(comdlg32 PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(comdlg32 uuid wine oldnames) add_delay_importlibs(comdlg32 ole32) add_importlibs(comdlg32 shell32 shlwapi comctl32 winspool user32 gdi32 advapi32 msvcrt kernel32 ntdll) diff --git a/dll/win32/credui/CMakeLists.txt b/dll/win32/credui/CMakeLists.txt index b638dce6bef..00408d24555 100644 --- a/dll/win32/credui/CMakeLists.txt +++ b/dll/win32/credui/CMakeLists.txt @@ -8,6 +8,7 @@ list(APPEND SOURCE add_library(credui MODULE ${SOURCE} credui.rc) set_module_type(credui win32dll) +target_compile_definitions(credui PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(credui wine oldnames) add_importlibs(credui advapi32 user32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET credui DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cryptdlg/CMakeLists.txt b/dll/win32/cryptdlg/CMakeLists.txt index 11eabe33dd2..9e884373b28 100644 --- a/dll/win32/cryptdlg/CMakeLists.txt +++ b/dll/win32/cryptdlg/CMakeLists.txt @@ -8,6 +8,7 @@ list(APPEND SOURCE add_library(cryptdlg MODULE ${SOURCE} cryptdlg.rc) set_module_type(cryptdlg win32dll) +target_compile_definitions(cryptdlg PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(cryptdlg wine) add_importlibs(cryptdlg advapi32 user32 crypt32 cryptui wintrust msvcrt kernel32 ntdll) add_cd_file(TARGET cryptdlg DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/cryptui/CMakeLists.txt b/dll/win32/cryptui/CMakeLists.txt index 37d5bb503e0..490a956883d 100644 --- a/dll/win32/cryptui/CMakeLists.txt +++ b/dll/win32/cryptui/CMakeLists.txt @@ -11,6 +11,7 @@ list(APPEND SOURCE add_library(cryptui MODULE ${SOURCE} cryptui.rc) set_module_type(cryptui win32dll) +target_compile_definitions(cryptui PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(cryptui uuid wine oldnames) add_delay_importlibs(cryptui urlmon wintrust) add_importlibs(cryptui user32 ole32 crypt32 gdi32 advapi32 comctl32 comdlg32 msvcrt kernel32 ntdll) diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt index 2a95dafa1b6..27310857b0c 100644 --- a/dll/win32/dbghelp/CMakeLists.txt +++ b/dll/win32/dbghelp/CMakeLists.txt @@ -1,6 +1,6 @@ if(NOT CMAKE_CROSSCOMPILING) - add_definitions(-DDBGHELP_STATIC_LIB -DNONAMELESSUNION) + add_definitions(-DDBGHELP_STATIC_LIB -DNONAMELESSUNION -D_CRT_NON_CONFORMING_SWPRINTFS) include_directories( ${REACTOS_SOURCE_DIR}/tools) @@ -28,6 +28,7 @@ else() add_definitions( -D_WINE -DHAVE_ALLOCA_H + -D_CRT_NON_CONFORMING_SWPRINTFS -D_IMAGEHLP_SOURCE_) include_directories( diff --git a/dll/win32/fusion/CMakeLists.txt b/dll/win32/fusion/CMakeLists.txt index 7159a2f9bdb..ae48074a986 100644 --- a/dll/win32/fusion/CMakeLists.txt +++ b/dll/win32/fusion/CMakeLists.txt @@ -11,6 +11,7 @@ list(APPEND COMMON_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/fusion_stubs.c) add_library(fusion_common STATIC ${COMMON_SOURCE}) +target_compile_definitions(fusion_common PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(fusion_common oldnames) add_dependencies(fusion_common psdk) add_pch(fusion_common precomp.h COMMON_SOURCE) diff --git a/dll/win32/ieframe/CMakeLists.txt b/dll/win32/ieframe/CMakeLists.txt index 75393fc8fff..9a63f911a8e 100644 --- a/dll/win32/ieframe/CMakeLists.txt +++ b/dll/win32/ieframe/CMakeLists.txt @@ -41,6 +41,7 @@ list(APPEND ieframe_rc_deps set_source_files_properties(ieframe.rc PROPERTIES OBJECT_DEPENDS "${ieframe_rc_deps}") add_dependencies(ieframe stdole2) set_module_type(ieframe win32dll) +target_compile_definitions(ieframe PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(ieframe uuid wine) add_importlibs(ieframe urlmon shell32 comctl32 shlwapi oleaut32 ole32 user32 gdi32 advapi32 msvcrt kernel32 ntdll) add_pch(ieframe precomp.h SOURCE) diff --git a/dll/win32/itss/CMakeLists.txt b/dll/win32/itss/CMakeLists.txt index 35283930d7e..0af66269cc6 100644 --- a/dll/win32/itss/CMakeLists.txt +++ b/dll/win32/itss/CMakeLists.txt @@ -1,5 +1,5 @@ -add_definitions(-D__ROS_LONG64__) +add_definitions(-D__ROS_LONG64__ -D_CRT_NON_CONFORMING_SWPRINTFS) spec2def(itss.dll itss.spec) list(APPEND SOURCE diff --git a/dll/win32/jscript/CMakeLists.txt b/dll/win32/jscript/CMakeLists.txt index c536ca7daf6..d201c6b67fe 100644 --- a/dll/win32/jscript/CMakeLists.txt +++ b/dll/win32/jscript/CMakeLists.txt @@ -54,6 +54,8 @@ add_library(jscript MODULE rsrc.rc ${CMAKE_CURRENT_BINARY_DIR}/jscript.def) +target_compile_definitions(jscript PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) + if(MSVC) # Disable warning C4146: unary minus operator applied to unsigned type, result still unsigned # Disable warning C4267: '=': conversion from 'size_t' to 'WCHAR', possible loss of data diff --git a/dll/win32/jsproxy/CMakeLists.txt b/dll/win32/jsproxy/CMakeLists.txt index 095193ad865..c7343d40174 100644 --- a/dll/win32/jsproxy/CMakeLists.txt +++ b/dll/win32/jsproxy/CMakeLists.txt @@ -8,6 +8,7 @@ list(APPEND SOURCE add_library(jsproxy MODULE ${SOURCE} rsrc.rc) set_module_type(jsproxy win32dll) +target_compile_definitions(jsproxy PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(jsproxy uuid wine) add_importlibs(jsproxy oleaut32 ole32 ws2_32 msvcrt kernel32 ntdll) add_cd_file(TARGET jsproxy DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mlang/CMakeLists.txt b/dll/win32/mlang/CMakeLists.txt index 451d1b5ed33..39dae081e8b 100644 --- a/dll/win32/mlang/CMakeLists.txt +++ b/dll/win32/mlang/CMakeLists.txt @@ -1,6 +1,6 @@ add_definitions( - -DCOM_NO_WINDOWS_H) + -DCOM_NO_WINDOWS_H -D_CRT_NON_CONFORMING_SWPRINTFS) spec2def(mlang.dll mlang.spec ADD_IMPORTLIB) diff --git a/dll/win32/mpr/CMakeLists.txt b/dll/win32/mpr/CMakeLists.txt index b0b435f5000..007048e3135 100644 --- a/dll/win32/mpr/CMakeLists.txt +++ b/dll/win32/mpr/CMakeLists.txt @@ -1,5 +1,6 @@ add_definitions( + -D_CRT_NON_CONFORMING_SWPRINTFS -D_WINE) spec2def(mpr.dll mpr.spec ADD_IMPORTLIB) diff --git a/dll/win32/msacm32/CMakeLists.txt b/dll/win32/msacm32/CMakeLists.txt index dda93b14d20..739eede596e 100644 --- a/dll/win32/msacm32/CMakeLists.txt +++ b/dll/win32/msacm32/CMakeLists.txt @@ -18,6 +18,7 @@ add_library(msacm32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/msacm32.def) set_module_type(msacm32 win32dll ENTRYPOINT DllMain 12 UNICODE) +target_compile_definitions(msacm32 PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(msacm32 wine oldnames) add_importlibs(msacm32 advapi32 user32 winmm msvcrt kernel32 ntdll) add_pch(msacm32 precomp.h SOURCE) diff --git a/dll/win32/oleacc/CMakeLists.txt b/dll/win32/oleacc/CMakeLists.txt index b42fa8951b8..5422af04141 100644 --- a/dll/win32/oleacc/CMakeLists.txt +++ b/dll/win32/oleacc/CMakeLists.txt @@ -1,5 +1,6 @@ add_definitions( + -D_CRT_NON_CONFORMING_SWPRINTFS -DENTRY_PREFIX=OLEACC_ -DPROXY_DELEGATION -DWINE_REGISTER_DLL) diff --git a/dll/win32/oleaut32/CMakeLists.txt b/dll/win32/oleaut32/CMakeLists.txt index 870a878c967..775630302fc 100644 --- a/dll/win32/oleaut32/CMakeLists.txt +++ b/dll/win32/oleaut32/CMakeLists.txt @@ -9,7 +9,8 @@ add_definitions( -DPROXY_DELEGATION -DWINE_REGISTER_DLL -DENTRY_PREFIX=OLEAUTPS_ - -DPROXY_CLSID=CLSID_PSFactoryBuffer) + -DPROXY_CLSID=CLSID_PSFactoryBuffer + -D_CRT_NON_CONFORMING_SWPRINTFS) spec2def(oleaut32.dll oleaut32.spec ADD_IMPORTLIB) add_rpcproxy_files(oleaut32_oaidl.idl oleaut32_ocidl.idl) diff --git a/dll/win32/pdh/CMakeLists.txt b/dll/win32/pdh/CMakeLists.txt index c13007bf952..f53faac9a1e 100644 --- a/dll/win32/pdh/CMakeLists.txt +++ b/dll/win32/pdh/CMakeLists.txt @@ -11,6 +11,7 @@ list(APPEND SOURCE add_library(pdh MODULE ${SOURCE}) set_module_type(pdh win32dll) +target_compile_definitions(pdh PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(pdh wine) add_importlibs(pdh msvcrt kernel32_vista kernel32 ntdll) add_cd_file(TARGET pdh DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/powrprof/CMakeLists.txt b/dll/win32/powrprof/CMakeLists.txt index a2b3ca0c056..02f2a75060b 100644 --- a/dll/win32/powrprof/CMakeLists.txt +++ b/dll/win32/powrprof/CMakeLists.txt @@ -12,6 +12,7 @@ if(MSVC) endif() set_module_type(powrprof win32dll UNICODE) +target_compile_definitions(powrprof PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(powrprof wine) add_importlibs(powrprof advapi32 user32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET powrprof DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/rpcrt4/CMakeLists.txt b/dll/win32/rpcrt4/CMakeLists.txt index 0fda3f72e67..277e32c9511 100644 --- a/dll/win32/rpcrt4/CMakeLists.txt +++ b/dll/win32/rpcrt4/CMakeLists.txt @@ -5,6 +5,7 @@ add_definitions(-D_WIN32_WINNT=0x600) add_definitions( -D_RPCRT4_ -DCOM_NO_WINDOWS_H + -D_CRT_NON_CONFORMING_SWPRINTFS -DMSWMSG) spec2def(rpcrt4.dll rpcrt4.spec ADD_IMPORTLIB) diff --git a/dll/win32/scrrun/CMakeLists.txt b/dll/win32/scrrun/CMakeLists.txt index 5ac216763d7..d4e88c45d8d 100644 --- a/dll/win32/scrrun/CMakeLists.txt +++ b/dll/win32/scrrun/CMakeLists.txt @@ -28,6 +28,7 @@ add_library(scrrun MODULE add_dependencies(scrrun scrrun_idlheader stdole2) set_module_type(scrrun win32dll) +target_compile_definitions(scrrun PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(scrrun uuid wine oldnames) add_importlibs(scrrun oleaut32 version advapi32 msvcrt kernel32 ntdll) add_pch(scrrun precomp.h "${PCH_SKIP_SOURCE}") diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 5d489474c9a..830a0f957f3 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -85,7 +85,7 @@ list(APPEND SOURCE CFolderItems.cpp CFolderItemVerbs.cpp) -list(APPEND PCH_SKIP_SOURCE +list(APPEND WINE_SOURCE appbar.c wine/classes.c wine/clipboard.c @@ -98,7 +98,12 @@ list(APPEND PCH_SKIP_SOURCE wine/shellreg.c wine/shellstring.c wine/shlmenu.c - wine/shpolicy.c + wine/shpolicy.c) + +set_source_files_properties(${WINE_SOURCE} PROPERTIES COMPILE_DEFINITIONS _CRT_NON_CONFORMING_SWPRINTFS) + +list(APPEND PCH_SKIP_SOURCE + ${WINE_SOURCE} vista.c ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c) diff --git a/dll/win32/sti/CMakeLists.txt b/dll/win32/sti/CMakeLists.txt index ceab06cd3da..2ff8b07037d 100644 --- a/dll/win32/sti/CMakeLists.txt +++ b/dll/win32/sti/CMakeLists.txt @@ -1,5 +1,6 @@ add_definitions( + -D_CRT_NON_CONFORMING_SWPRINTFS -DENTRY_PREFIX=STI_ -DPROXY_DELEGATION -DWINE_REGISTER_DLL) diff --git a/dll/win32/sxs/CMakeLists.txt b/dll/win32/sxs/CMakeLists.txt index ab8e6439ec8..ae4826e1a9c 100644 --- a/dll/win32/sxs/CMakeLists.txt +++ b/dll/win32/sxs/CMakeLists.txt @@ -16,6 +16,7 @@ add_library(sxs MODULE ${CMAKE_CURRENT_BINARY_DIR}/sxs.def) set_module_type(sxs win32dll) +target_compile_definitions(sxs PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(sxs wine) add_importlibs(sxs oleaut32 ole32 msvcrt kernel32 ntdll) add_pch(sxs precomp.h "${PCH_SKIP_SOURCE}") diff --git a/dll/win32/tapi32/CMakeLists.txt b/dll/win32/tapi32/CMakeLists.txt index 33f2ad410e7..823fe14ec5f 100644 --- a/dll/win32/tapi32/CMakeLists.txt +++ b/dll/win32/tapi32/CMakeLists.txt @@ -14,6 +14,7 @@ add_library(tapi32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/tapi32.def) set_module_type(tapi32 win32dll) +target_compile_definitions(tapi32 PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(tapi32 wine) add_importlibs(tapi32 advapi32 msvcrt kernel32 ntdll) add_pch(tapi32 precomp.h SOURCE) diff --git a/dll/win32/urlmon/CMakeLists.txt b/dll/win32/urlmon/CMakeLists.txt index 43d3f7d8c43..64ba237e233 100644 --- a/dll/win32/urlmon/CMakeLists.txt +++ b/dll/win32/urlmon/CMakeLists.txt @@ -4,6 +4,7 @@ add_definitions( -DENTRY_PREFIX=URLMON_ -DPROXY_DELEGATION -DWINE_REGISTER_DLL + -D_CRT_NON_CONFORMING_SWPRINTFS -DPROXY_CLSID_IS={0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}) spec2def(urlmon.dll urlmon.spec ADD_IMPORTLIB) diff --git a/dll/win32/usp10/CMakeLists.txt b/dll/win32/usp10/CMakeLists.txt index a9e174e8cc5..47229fcb8c2 100644 --- a/dll/win32/usp10/CMakeLists.txt +++ b/dll/win32/usp10/CMakeLists.txt @@ -22,6 +22,7 @@ add_library(usp10 MODULE ${CMAKE_CURRENT_BINARY_DIR}/usp10.def) set_module_type(usp10 win32dll) +target_compile_definitions(usp10 PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(usp10 wine) add_importlibs(usp10 advapi32 user32 gdi32 msvcrt kernel32 ntdll) add_pch(usp10 precomp.h SOURCE) diff --git a/dll/win32/wbemprox/CMakeLists.txt b/dll/win32/wbemprox/CMakeLists.txt index d167042267f..da38645c41f 100644 --- a/dll/win32/wbemprox/CMakeLists.txt +++ b/dll/win32/wbemprox/CMakeLists.txt @@ -34,6 +34,7 @@ add_library(wbemprox MODULE set_source_files_properties(wbemprox.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/wbemprox.rgs) set_module_type(wbemprox win32dll) +target_compile_definitions(wbemprox PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(wbemprox uuid wine oldnames) add_importlibs(wbemprox iphlpapi oleaut32 advapi32 user32 gdi32 version winspool ws2_32 rpcrt4 setupapi msvcrt kernel32 ntdll) add_dependencies(wbemprox d3d_idl_headers) diff --git a/dll/win32/wmiutils/CMakeLists.txt b/dll/win32/wmiutils/CMakeLists.txt index 17660182720..94fdd960b6c 100644 --- a/dll/win32/wmiutils/CMakeLists.txt +++ b/dll/win32/wmiutils/CMakeLists.txt @@ -9,6 +9,7 @@ list(APPEND SOURCE add_library(wmiutils MODULE ${SOURCE} wmiutils.rc) set_module_type(wmiutils win32dll) +target_compile_definitions(wmiutils PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(wmiutils wine) add_importlibs(wmiutils oleaut32 msvcrt kernel32 ntdll) add_cd_file(TARGET wmiutils DESTINATION reactos/system32/wbem FOR all) diff --git a/dll/win32/wshom.ocx/CMakeLists.txt b/dll/win32/wshom.ocx/CMakeLists.txt index b72b00c4b44..7146137b9af 100644 --- a/dll/win32/wshom.ocx/CMakeLists.txt +++ b/dll/win32/wshom.ocx/CMakeLists.txt @@ -26,6 +26,7 @@ list(APPEND wshom_rc_deps set_source_files_properties(wshom.rc PROPERTIES OBJECT_DEPENDS "${wshom_rc_deps}") set_module_type(wshom win32ocx) +target_compile_definitions(wshom PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(wshom uuid wine oldnames) add_importlibs(wshom oleaut32 ole32 shell32 advapi32 advapi32_vista user32 msvcrt kernel32 ntdll) add_dependencies(wshom stdole2 wshom_idlheader) diff --git a/dll/win32/xmllite/CMakeLists.txt b/dll/win32/xmllite/CMakeLists.txt index faf19328bdb..feafc855f10 100644 --- a/dll/win32/xmllite/CMakeLists.txt +++ b/dll/win32/xmllite/CMakeLists.txt @@ -19,6 +19,7 @@ if(MSVC) endif() set_module_type(xmllite win32dll) +target_compile_definitions(xmllite PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) target_link_libraries(xmllite uuid wine oldnames) add_importlibs(xmllite msvcrt kernel32 ntdll) add_pch(xmllite precomp.h SOURCE) diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index bdf5bcb9014..20e0fded969 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -88,6 +88,8 @@ list(APPEND SOURCE add_library(ext2fs MODULE ${SOURCE} ext2fs.rc) +target_compile_definitions(ext2fs PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # Disable warning C4101: 'i': unreferenced local variable # Disable warning C4189: 'sbi': local variable is initialized but not referenced diff --git a/drivers/filesystems/udfs/CMakeLists.txt b/drivers/filesystems/udfs/CMakeLists.txt index 6fcfba012ef..77f00c17032 100644 --- a/drivers/filesystems/udfs/CMakeLists.txt +++ b/drivers/filesystems/udfs/CMakeLists.txt @@ -41,6 +41,8 @@ list(APPEND SOURCE add_library(udfs MODULE ${SOURCE} udffs.rc) +target_compile_definitions(udfs PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) + if(CMAKE_C_COMPILER_ID STREQUAL "GNU") target_compile_options(udfs PRIVATE -Wno-unused-but-set-variable) endif() diff --git a/drivers/storage/ide/uniata/CMakeLists.txt b/drivers/storage/ide/uniata/CMakeLists.txt index 9b9d721e242..d1ef30de9de 100644 --- a/drivers/storage/ide/uniata/CMakeLists.txt +++ b/drivers/storage/ide/uniata/CMakeLists.txt @@ -41,6 +41,7 @@ endif() add_pch(uniata stdafx.h SOURCE) set_module_type(uniata kernelmodedriver) +target_compile_definitions(uniata PRIVATE _CRT_NON_CONFORMING_SWPRINTFS) add_importlibs(uniata scsiport ntoskrnl hal) add_cd_file(TARGET uniata DESTINATION reactos/system32/drivers NO_CAB FOR all) # add_registry_inf(uniata_reg.inf)