From aa76a2c168935541949f42bb7b507861af1393da Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Sun, 26 Apr 2015 17:08:34 +0000 Subject: [PATCH] [ROSAPPS] put -Wno-unused-but-set-variable between a if(NOT MSVC) to really make MSVC happy this time / Get rid of -Wno-implicit-function-declaration (include juggling + add definitions) and -Wno-format-extra-args (shorten sprinf) in ncftp. / Fix rosperf build and add it to cmake build now. svn path=/trunk/; revision=67439 --- rosapps/applications/devutils/symdump/CMakeLists.txt | 4 +++- rosapps/applications/net/ncftp/CMakeLists.txt | 6 +++++- rosapps/applications/net/ncftp/libncftp/syshdrs.h | 2 -- rosapps/applications/net/ncftp/ncftp/cmds.c | 2 +- rosapps/applications/net/ncftp/ncftp/syshdrs.h | 2 ++ rosapps/applications/net/ncftp/sio/syshdrs.h | 2 +- rosapps/applications/sysutils/logevent/CMakeLists.txt | 4 +++- rosapps/applications/sysutils/pedump/CMakeLists.txt | 4 +++- rosapps/applications/sysutils/utils/CMakeLists.txt | 2 +- rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt | 4 +++- rosapps/applications/sysutils/utils/rosperf/rosperf.c | 4 ++-- rosapps/templates/dialog/CMakeLists.txt | 4 +++- 12 files changed, 27 insertions(+), 13 deletions(-) diff --git a/rosapps/applications/devutils/symdump/CMakeLists.txt b/rosapps/applications/devutils/symdump/CMakeLists.txt index fde97137617..ffaddf02dc3 100644 --- a/rosapps/applications/devutils/symdump/CMakeLists.txt +++ b/rosapps/applications/devutils/symdump/CMakeLists.txt @@ -4,5 +4,7 @@ add_executable(symdump symdump.c) set_module_type(symdump win32cui) target_link_libraries(symdump wine) add_importlibs(symdump dbghelp shlwapi msvcrt kernel32) -add_compile_flags("-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(symdump "-Wno-unused-but-set-variable") +endif() add_cd_file(TARGET symdump DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/net/ncftp/CMakeLists.txt b/rosapps/applications/net/ncftp/CMakeLists.txt index d3f3a135d44..58e794cdc94 100644 --- a/rosapps/applications/net/ncftp/CMakeLists.txt +++ b/rosapps/applications/net/ncftp/CMakeLists.txt @@ -70,6 +70,10 @@ list(APPEND SOURCE add_executable(ncftp ${SOURCE} ncftp.rc) set_module_type(ncftp win32cui) -add_target_compile_flags(ncftp "-Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-format-extra-args") +if(NOT MSVC) + add_target_compile_flags(ncftp "-DHAVE_UTIME_H -DHAVE_UNISTD_H -Wno-unused-but-set-variable") +else() + add_target_compile_flags(ncftp "-DHAVE_UTIME_H -DHAVE_UNISTD_H") +endif() add_importlibs(ncftp advapi32 user32 ws2_32 msvcrt kernel32) add_cd_file(TARGET ncftp DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/net/ncftp/libncftp/syshdrs.h b/rosapps/applications/net/ncftp/libncftp/syshdrs.h index 344db2ec41c..e3d29b7bdb9 100644 --- a/rosapps/applications/net/ncftp/libncftp/syshdrs.h +++ b/rosapps/applications/net/ncftp/libncftp/syshdrs.h @@ -50,8 +50,6 @@ # define lstat _stat # define fstat _fstat # define dup _dup -# define utime _utime -# define utimbuf _utimbuf # endif # ifndef unlink # define unlink remove diff --git a/rosapps/applications/net/ncftp/ncftp/cmds.c b/rosapps/applications/net/ncftp/ncftp/cmds.c index d90e897bcae..e3ec8488f9d 100644 --- a/rosapps/applications/net/ncftp/ncftp/cmds.c +++ b/rosapps/applications/net/ncftp/ncftp/cmds.c @@ -1211,7 +1211,7 @@ RunBookmarkEditor(char *selectedBmName, size_t dsize) SysPerror("CreateMailslot"); (void) fprintf(stderr, "Could not create communication channel with %s.\n", "ncftpbookmarks.exe"); (void) fprintf(stderr, "%s", "This means if you select a bookmark to connect to that NcFTP\n"); - (void) fprintf(stderr, "%s", "will not get the message from %s.\n", "ncftpbookmarks.exe"); + (void) fprintf(stderr, "%s", "will not get the message from %s.\n"); } winExecResult = WinExec(prog, SW_SHOWNORMAL); diff --git a/rosapps/applications/net/ncftp/ncftp/syshdrs.h b/rosapps/applications/net/ncftp/ncftp/syshdrs.h index 3a4d6392905..c8b1d84f486 100644 --- a/rosapps/applications/net/ncftp/ncftp/syshdrs.h +++ b/rosapps/applications/net/ncftp/ncftp/syshdrs.h @@ -44,6 +44,8 @@ # include # include # include +# include +# include # undef strcasecmp # define strcasecmp stricmp # undef strncasecmp diff --git a/rosapps/applications/net/ncftp/sio/syshdrs.h b/rosapps/applications/net/ncftp/sio/syshdrs.h index d9c65137a49..5279757433b 100644 --- a/rosapps/applications/net/ncftp/sio/syshdrs.h +++ b/rosapps/applications/net/ncftp/sio/syshdrs.h @@ -13,6 +13,7 @@ /* Include "wincfg.h" in place of "config.h" */ # include "wincfg.h" # include /* includes */ +# include # define _POSIX_ 1 # ifdef HAVE_UNISTD_H # include @@ -28,7 +29,6 @@ # include # include # include -# include # include # include # include diff --git a/rosapps/applications/sysutils/logevent/CMakeLists.txt b/rosapps/applications/sysutils/logevent/CMakeLists.txt index 2dfeca5204f..b737ad2022f 100644 --- a/rosapps/applications/sysutils/logevent/CMakeLists.txt +++ b/rosapps/applications/sysutils/logevent/CMakeLists.txt @@ -1,6 +1,8 @@ add_executable(logevent logevent.c logevent.rc) set_module_type(logevent win32cui) -add_target_compile_flags(logevent "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(logevent "-Wno-unused-but-set-variable") +endif() add_importlibs(logevent advapi32 msvcrt kernel32) add_cd_file(TARGET logevent DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/sysutils/pedump/CMakeLists.txt b/rosapps/applications/sysutils/pedump/CMakeLists.txt index 1acb8b46372..b2805cbc346 100644 --- a/rosapps/applications/sysutils/pedump/CMakeLists.txt +++ b/rosapps/applications/sysutils/pedump/CMakeLists.txt @@ -1,6 +1,8 @@ add_executable(pedump pedump.c pedump.rc) set_module_type(pedump win32cui) -add_target_compile_flags(pedump "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(pedump "-Wno-unused-but-set-variable") +endif() add_importlibs(pedump msvcrt kernel32 ntdll) add_cd_file(TARGET pedump DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/sysutils/utils/CMakeLists.txt b/rosapps/applications/sysutils/utils/CMakeLists.txt index d8d987aaf5e..928d21ec511 100644 --- a/rosapps/applications/sysutils/utils/CMakeLists.txt +++ b/rosapps/applications/sysutils/utils/CMakeLists.txt @@ -6,6 +6,6 @@ add_subdirectory(nts2w32err) add_subdirectory(objdir) add_subdirectory(partinfo) add_subdirectory(ps) -#add_subdirectory(rosperf) +add_subdirectory(rosperf) add_subdirectory(stats) add_subdirectory(tickcount) diff --git a/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt b/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt index 0bda35027f2..92d9621eadc 100644 --- a/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt +++ b/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt @@ -11,6 +11,8 @@ list(APPEND SOURCE add_executable(rosperf ${SOURCE} rosperf.rc) set_module_type(rosperf win32cui UNICODE) -add_target_compile_flags(rosperf "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(rosperf "-Wno-unused-but-set-variable") +endif() add_importlibs(rosperf version msimg32 gdi32 shell32 advapi32 user32 ntdll msvcrt kernel32) add_cd_file(TARGET rosperf DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/sysutils/utils/rosperf/rosperf.c b/rosapps/applications/sysutils/utils/rosperf/rosperf.c index 77148a839ac..8f9acf4c7be 100644 --- a/rosapps/applications/sysutils/utils/rosperf/rosperf.c +++ b/rosapps/applications/sysutils/utils/rosperf/rosperf.c @@ -858,9 +858,9 @@ ProcessCommandLine(PPERF_INFO PerfInfo, unsigned *TestCount, PTEST *Tests) } int WINAPI -WinMain(HINSTANCE hInstance, +wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, + LPWSTR lpszCmdLine, int nCmdShow) { PTEST Tests; diff --git a/rosapps/templates/dialog/CMakeLists.txt b/rosapps/templates/dialog/CMakeLists.txt index f209f002886..6102bb4bfb4 100644 --- a/rosapps/templates/dialog/CMakeLists.txt +++ b/rosapps/templates/dialog/CMakeLists.txt @@ -9,6 +9,8 @@ list(APPEND SOURCE add_executable(template_dialog ${SOURCE} dialog.rc) set_module_type(template_dialog win32cui) -add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable") +endif() add_importlibs(template_dialog user32 gdi32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET template_dialog DESTINATION reactos/system32 FOR all) -- 2.17.1