stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r329257 - /incubator/stdcxx/trunk/etc/config/src/UNISTD_DECL.cpp
Date Fri, 28 Oct 2005 17:49:57 GMT
Author: sebor
Date: Fri Oct 28 10:49:53 2005
New Revision: 329257

URL: http://svn.apache.org/viewcvs?rev=329257&view=rev
Log:
2005-10-28  Martin Sebor  <sebor@roguewave.com>

	* UNISTD_DECL.cpp: Hardcoded the definition of ssize_t for Windows which
	doesn't define the type (the SDK defines the equivalent type as SSIZE_T
	but the header may not be available in the base kit).

Modified:
    incubator/stdcxx/trunk/etc/config/src/UNISTD_DECL.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/UNISTD_DECL.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/UNISTD_DECL.cpp?rev=329257&r1=329256&r2=329257&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/UNISTD_DECL.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/UNISTD_DECL.cpp Fri Oct 28 10:49:53 2005
@@ -14,15 +14,21 @@
 #  include <unistd.h>
 #endif   // _WIN32 || _WIN64
 
+// Windows defines the equivalent SSIZE_T in the platform SDK
+// as the signed equivalent of size_t which is defined as long
+// on WIN32 and long long/__int64 on WIN64
+#if defined (_WIN64)
+#  define ssize_t __int64
+#elif defined (_WIN32)
+#  define ssize_t long
+#endif
+
 #ifndef STDIN_FILENO
 #  define STDIN_FILENO    0
 #  define STDOUT_FILENO   1
 #  define STDERR_FILENO   2
 #endif   // STDIN_FILENO
 
-#if defined (_RWSTD_NO_SSIZE_T)
-#  define ssize_t long
-#endif
 
 static void print_macros ()
 {
@@ -81,13 +87,33 @@
 const char* ssize_t_name (unsigned long)      { return "unsigned long"; }
 
 #ifndef _RWSTD_NO_LONG_LONG
+#  define LONG_LONG   long long
+#elif defined (_WIN32) || defined (_WIN64)
+#  define LONG_LONG   __int64
+#endif   // _RWSTD_NO_LONG_LONG, _WIN{32,64}
+
 
-const char* off_t_name (long long)            { return "long long"; }
+#if defined (LONG_LONG)
 
-const char* ssize_t_name (long long)          { return "long long"; }
-const char* ssize_t_name (unsigned long long) { return "unsigned long long"; }
+#  define STRSTR(x)   #x
+#  define STR(x)      STRSTR (x)
+
+const char* off_t_name (LONG_LONG)
+{
+    return STR (LONG_LONG);
+}
+
+const char* ssize_t_name (LONG_LONG)
+{
+    return STR (LONG_ LONG);
+}
+
+const char* ssize_t_name (unsigned LONG_LONG)
+{
+    return STR (unsigned LONG_LONG);
+}
 
-#endif   // _RWSTD_NO_LONG_LONG
+#endif   // LONG_LONG
 
 
 int main ()



Mime
View raw message