[Box Backup-commit] COMMIT r2765 - in box/invisnet/vs2010/0.11/lib: common win32

subversion at boxbackup.org subversion at boxbackup.org
Sun Oct 3 03:24:35 BST 2010


Author: invisnet
Date: 2010-10-03 03:24:34 +0100 (Sun, 03 Oct 2010)
New Revision: 2765

Modified:
   box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h
   box/invisnet/vs2010/0.11/lib/win32/emu.h
Log:
_CRT_NONSTDC_NO_DEPRECATE deals with the POSIX deprication nonsense; polling is supported in later SDKs; compiler warnings should be fixed, not hidden; O_BINARY gets defined in emu.h

Modified: box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h	2010-10-02 21:02:32 UTC (rev 2764)
+++ box/invisnet/vs2010/0.11/lib/common/BoxPlatform.h	2010-10-03 02:24:34 UTC (rev 2765)
@@ -159,11 +159,6 @@
 	#define INFTIM -1
 #endif
 
-// for Unix compatibility with Windows :-)
-#ifndef O_BINARY
-	#define O_BINARY 0
-#endif
-
 #ifdef WIN32
 	typedef u_int64_t InodeRefType;
 #else

Modified: box/invisnet/vs2010/0.11/lib/win32/emu.h
===================================================================
--- box/invisnet/vs2010/0.11/lib/win32/emu.h	2010-10-02 21:02:32 UTC (rev 2764)
+++ box/invisnet/vs2010/0.11/lib/win32/emu.h	2010-10-03 02:24:34 UTC (rev 2765)
@@ -74,17 +74,6 @@
 
 #define ITIMER_REAL 0
 
-#ifdef _MSC_VER
-// Microsoft decided to deprecate the standard POSIX functions. Great!
-#define open(file,flags,mode) _open(file,flags,mode)
-#define close(fd)             _close(fd)
-#define dup(fd)               _dup(fd)
-#define read(fd,buf,count)    _read(fd,buf,count)
-#define write(fd,buf,count)   _write(fd,buf,count)
-#define lseek(fd,off,whence)  _lseek(fd,off,whence)
-#define fileno(struct_file)   _fileno(struct_file)
-#endif
-
 struct passwd {
 	char *pw_name;
 	char *pw_passwd;
@@ -286,20 +275,24 @@
 }
 
 #define INFTIM -1
+#if(_WIN32_WINNT < 0x0600)
 #define POLLIN 0x1
 #define POLLERR 0x8
 #define POLLOUT 0x4
+#endif
 
 #define SHUT_RDWR SD_BOTH
 #define SHUT_RD SD_RECEIVE
 #define SHUT_WR SD_SEND
 
+#if(_WIN32_WINNT < 0x0600)
 struct pollfd
 {
 	SOCKET fd;
 	short int events;
 	short int revents;
 };
+#endif
 
 inline int ioctl(SOCKET sock, int flag,  int * something)
 {
@@ -409,16 +402,4 @@
 // relatively recent C runtime lib
 int console_read(char* pBuffer, size_t BufferSize);
 
-#ifdef _MSC_VER
-	/* disable certain compiler warnings to be able to actually see the show-stopper ones */
-	#pragma warning(disable:4101)		// unreferenced local variable
-	#pragma warning(disable:4244)		// conversion, possible loss of data
-	#pragma warning(disable:4267)		// conversion, possible loss of data
-	#pragma warning(disable:4311)		// pointer truncation
-	#pragma warning(disable:4700)		// uninitialized local variable used (hmmmmm...)
-	#pragma warning(disable:4805)		// unsafe mix of type and type 'bool' in operation
-	#pragma warning(disable:4800)		// forcing value to bool 'true' or 'false' (performance warning)
-	#pragma warning(disable:4996)		// POSIX name for this item is deprecated
-#endif // _MSC_VER
-
 #endif // !EMU_INCLUDE && WIN32




More information about the Boxbackup-commit mailing list