Workaround for Resource Compiler warnings/errors under VS2010.
authorMathias Breiner <mathias.breiner@gameforge.com>
Thu, 11 Feb 2016 18:31:26 +0000 (19:31 +0100)
committerIain Patterson <me@iain.cx>
Sun, 28 Feb 2016 08:28:42 +0000 (08:28 +0000)
VS2010 RC.exe yielded lots of warnings and some errors when including some (unnecessary) platform header files via nssm.h. So now including only what is really required.
This includes a workaround for error RC2247 found here: http://stackoverflow.com/a/18317658

nssm.h
nssm.rc

diff --git a/nssm.h b/nssm.h
index 911804f..f500a33 100644 (file)
--- a/nssm.h
+++ b/nssm.h
 #define DIR_LENGTH PATH_LENGTH - 12\r
 \r
 #define _WIN32_WINNT 0x0500\r
+\r
+#define APSTUDIO_HIDDEN_SYMBOLS\r
+#include <windows.h>\r
+#include <prsht.h>\r
+#undef APSTUDIO_HIDDEN_SYMBOLS\r
+#include <commctrl.h>\r
+#include <tchar.h>\r
+#ifndef NSSM_COMPILE_RC\r
 #include <fcntl.h>\r
 #include <io.h>\r
 #include <shlwapi.h>\r
 #include <stdarg.h>\r
 #include <stdio.h>\r
-#include <tchar.h>\r
-#include <windows.h>\r
 #include "service.h"\r
 #include "account.h"\r
 #include "console.h"\r
@@ -53,6 +59,7 @@
 #include "settings.h"\r
 #include "io.h"\r
 #include "gui.h"\r
+#endif\r
 \r
 int str_equiv(const TCHAR *, const TCHAR *);\r
 void strip_basename(TCHAR *);\r
diff --git a/nssm.rc b/nssm.rc
index ee44017..7104cca 100644 (file)
Binary files a/nssm.rc and b/nssm.rc differ