[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r13670: Make torint.h define ssize_t more robustly; add spaces to la (in tor/trunk: . src/common)



Author: nickm
Date: 2008-02-21 22:26:35 -0500 (Thu, 21 Feb 2008)
New Revision: 13670

Modified:
   tor/trunk/
   tor/trunk/src/common/compat.c
   tor/trunk/src/common/torint.h
Log:
 r18360@catbus:  nickm | 2008-02-21 22:26:32 -0500
 Make torint.h define ssize_t more robustly; add spaces to last patch



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r18360] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c	2008-02-22 03:23:20 UTC (rev 13669)
+++ tor/trunk/src/common/compat.c	2008-02-22 03:26:35 UTC (rev 13670)
@@ -779,7 +779,7 @@
 #ifdef MS_WINDOWS
   if (limit > DEFAULT_MAX_CONNECTIONS) {
     log_warn(LD_CONFIG,
-             "We do not support more than %lu file descriptors"
+             "We do not support more than %lu file descriptors "
              "on Windows. Tried to raise to %lu.",
              DEFAULT_MAX_CONNECTIONS, limit);
     return -1;
@@ -787,7 +787,7 @@
   limit = DEFAULT_MAX_CONNECTIONS;
 #elif defined(CYGWIN) || defined(__CYGWIN__)
   if (limit > CYGWIN_MAX_CONNECTIONS) {
-    log_warn(LD_CONFIG, "We do not support more than %lu file descriptors"
+    log_warn(LD_CONFIG, "We do not support more than %lu file descriptors "
              "when using Cygwin. Tried to raise to %lu.",
              CYGWIN_MAX_CONNECTIONS, limit);
     return -1;
@@ -795,7 +795,7 @@
   limit = CYGWIN_MAX_CONNECTIONS;
 #elif defined(IPHONE)
   if (limit > IPHONE_MAX_CONNECTIONS) {
-    log_warn(LD_CONFIG, "We do not support more than %lu file descriptors"
+    log_warn(LD_CONFIG, "We do not support more than %lu file descriptors "
              "on iPhone. Tried to raise to %lu.",
              IPHONE_MAX_CONNECTIONS, limit);
     return -1;

Modified: tor/trunk/src/common/torint.h
===================================================================
--- tor/trunk/src/common/torint.h	2008-02-22 03:23:20 UTC (rev 13669)
+++ tor/trunk/src/common/torint.h	2008-02-22 03:26:35 UTC (rev 13670)
@@ -42,11 +42,6 @@
 #include <inttypes.h>
 #endif
 
-#ifdef MS_WINDOWS
-/* Windows likes to capitalize ssize_t.  Charming. */
-#define ssize_t SSIZE_T
-#endif
-
 #if (SIZEOF_INT8_T != 0)
 #define HAVE_INT8_T
 #endif
@@ -186,6 +181,16 @@
 #endif
 #endif
 
+#ifndef HAVE_SSIZE_T
+#if SIZEOF_SIZE_T == 8
+typedef int64_t ssize_t;
+#elif SIZEOF_SIZE_T == 4
+typedef int32_t ssize_t;
+#else
+#error "Can't define ssize_t."
+#endif
+#endif
+
 #if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8)
 #ifndef HAVE_INTPTR_T
 typedef int64_t intptr_t;