13 Apr
2008
13 Apr
'08
4:06 a.m.
Juergen Schoenwaelder wrote:
On Fri, Apr 11, 2008 at 09:25:44AM +0200, Anders Broman wrote:
How about this then:
The attached patch shuts up all the ISO C++ deprecations warnings in MSVC8. (In CRLF format. You might want to convert to Unix format.)
It might take "#if _MSV_VER > something" for earlier versions like MSVC6. I don't have a copy of MSVC6. I could put MSCV7 on a VM to test it.
http://predef.sourceforge.net/precomp.html#sec32
has a list of appropriate values.
The file make.log has all the remaining MSVC8 errors. "size_t" being different to "int" seems to be the main complaint.
A potential danger is that (xxx *) and size_t could be 64 bit while int and unsigned could be 32 bit. Then (xxx *)a -(xxx *)b might not be 32 bit representable.
--
There's no point in being grown up if you can't be childish sometimes.
-- Dr. Who
Index: C:/libsmi/trunk/win/win.h
===================================================================
--- C:/libsmi/trunk/win/win.h (revision 8032)
+++ C:/libsmi/trunk/win/win.h (working copy)
@@ -78,13 +78,20 @@
#if defined(_MSC_VER)
#define strtof(f1,f2) ((float)strtod(f1,f2))
-#endif
/*
- * Windows compiler writers seem to rename standard functions...
- * Perhaps this #define needs to be qualified someone...
+ * Windows compiler writers love to issue warnings for C functions
+ * whose names were changed by C++ standards.
+ * Since access is used as the name of a structure member it has to
+ * be treated differently.
*/
-#define vsnprintf _vsnprintf
+#define access(f1,f2) _access(f1,f2)
+#define putenv _putenv
+#define strdup _strdup
+#define stricmp _stricmp
+#define vsnprintf _vsnprintf
+#endif /* _MSC_VER */
+
#endif /* _WIN_H */