Browse code

win32: fix warns

aCaB authored on 2009/11/01 03:12:50
Showing 6 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Oct 31 19:12:22 CET 2009 (acab)
2
+-----------------------------------
3
+ * win32: fix warnings
4
+
1 5
 Fri Oct 30 14:04:43 EET 2009 (edwin)
2 6
 ------------------------------------
3 7
  * configure, m4/acinclude.m4: Avoid trailing slash in libdir for old gcc (#1738).
... ...
@@ -61,9 +61,9 @@
61 61
 
62 62
 #define DCONF ctx->dconf->pe
63 63
 
64
-#define IMAGE_DOS_SIGNATURE	    0x5a4d	    /* MZ */
65
-#define IMAGE_DOS_SIGNATURE_OLD	    0x4d5a          /* ZM */
66
-#define IMAGE_NT_SIGNATURE	    0x00004550
64
+#define PE_IMAGE_DOS_SIGNATURE	    0x5a4d	    /* MZ */
65
+#define PE_IMAGE_DOS_SIGNATURE_OLD  0x4d5a          /* ZM */
66
+#define PE_IMAGE_NT_SIGNATURE	    0x00004550
67 67
 #define PE32_SIGNATURE		    0x010b
68 68
 #define PE32P_SIGNATURE		    0x020b
69 69
 
... ...
@@ -429,7 +429,7 @@ int cli_scanpe(cli_ctx *ctx)
429 429
 	return CL_CLEAN;
430 430
     }
431 431
 
432
-    if(EC16(e_magic) != IMAGE_DOS_SIGNATURE && EC16(e_magic) != IMAGE_DOS_SIGNATURE_OLD) {
432
+    if(EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE && EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE_OLD) {
433 433
 	cli_dbgmsg("Invalid DOS signature\n");
434 434
 	return CL_CLEAN;
435 435
     }
... ...
@@ -2141,7 +2141,7 @@ int cli_peheader(fmap_t *map, struct cli_exe_info *peinfo)
2141 2141
 	return CL_CLEAN;
2142 2142
     }
2143 2143
 
2144
-    if(EC16(e_magic) != IMAGE_DOS_SIGNATURE && EC16(e_magic) != IMAGE_DOS_SIGNATURE_OLD) {
2144
+    if(EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE && EC16(e_magic) != PE_IMAGE_DOS_SIGNATURE_OLD) {
2145 2145
 	cli_dbgmsg("Invalid DOS signature\n");
2146 2146
 	return -1;
2147 2147
     }
... ...
@@ -943,10 +943,6 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo
943 943
 
944 944
 		arg = NULL;
945 945
 		if(err) break;
946
-
947
-		if(sizeof(lnumarg) > sizeof(numarg) && (lnumarg >> (sizeof(numarg)<<3)) )
948
-		    errno = ERANGE;
949
-
950 946
 		if(errno == ERANGE) {
951 947
 		    if(cfgfile) {
952 948
 			fprintf(stderr, "WARNING: Numerical value for option %s too high, resetting to 4G\n", name);
... ...
@@ -50,7 +50,7 @@
50 50
 				WarningLevel="3"
51 51
 				DebugInformationFormat="3"
52 52
 				CompileAs="1"
53
-				DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146"
53
+				DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146;4102"
54 54
 			/>
55 55
 			<Tool
56 56
 				Name="VCManagedResourceCompilerTool"
... ...
@@ -127,7 +127,7 @@
127 127
 				WarningLevel="3"
128 128
 				DebugInformationFormat="3"
129 129
 				CompileAs="1"
130
-				DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146"
130
+				DisableSpecificWarnings="4996;4244;4018;4090;4333;4101;4146;4102"
131 131
 			/>
132 132
 			<Tool
133 133
 				Name="VCManagedResourceCompilerTool"
... ...
@@ -42,7 +42,7 @@
42 42
 				Name="VCCLCompilerTool"
43 43
 				Optimization="0"
44 44
 				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)compat&quot;;&quot;$(SolutionDir)3rdparty\zlib&quot;;&quot;$(SolutionDir)3rdparty\pthreads&quot;;&quot;$(SolutionDir)3rdparty\bzip2&quot;;&quot;$(SolutionDir)..&quot;"
45
-				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB"
45
+				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV"
46 46
 				MinimalRebuild="true"
47 47
 				BasicRuntimeChecks="3"
48 48
 				RuntimeLibrary="3"
... ...
@@ -121,7 +121,7 @@
121 121
 				Optimization="2"
122 122
 				EnableIntrinsicFunctions="true"
123 123
 				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)compat&quot;;&quot;$(SolutionDir)3rdparty\zlib&quot;;&quot;$(SolutionDir)3rdparty\pthreads&quot;;&quot;$(SolutionDir)3rdparty\bzip2&quot;;&quot;$(SolutionDir)..&quot;"
124
-				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB"
124
+				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV"
125 125
 				RuntimeLibrary="2"
126 126
 				BufferSecurityCheck="false"
127 127
 				EnableFunctionLevelLinking="true"
... ...
@@ -67,11 +67,16 @@ typedef	unsigned	int	in_addr_t;
67 67
 
68 68
 #undef DATADIR
69 69
 #undef CONFDIR
70
-__declspec(dllimport) extern const char *DATADIR;
71
-__declspec(dllimport) extern const char *CONFDIR;
72
-__declspec(dllimport) extern const char *CONFDIR_CLAMD;
73
-__declspec(dllimport) extern const char *CONFDIR_FRESHCLAM;
74
-__declspec(dllimport) extern const char *CONFDIR_MILTER;
70
+#if !defined(THIS_IS_LIBCLAMAV) && defined(_MSC_VER)
71
+#define LIBCLAMAV_EXPORT __declspec(dllimport)
72
+#else
73
+#define LIBCLAMAV_EXPORT
74
+#endif
75
+LIBCLAMAV_EXPORT extern const char *DATADIR;
76
+LIBCLAMAV_EXPORT extern const char *CONFDIR;
77
+LIBCLAMAV_EXPORT extern const char *CONFDIR_CLAMD;
78
+LIBCLAMAV_EXPORT extern const char *CONFDIR_FRESHCLAM;
79
+LIBCLAMAV_EXPORT extern const char *CONFDIR_MILTER;
75 80
 #undef HAVE_CONFIG_H
76 81
 
77 82
 #endif /* __PLATFORM_H */
78 83
\ No newline at end of file