[Spread-cvs] commit: r560 - in libspreadutil/trunk: . src

jonathan at spread.org jonathan at spread.org
Wed Mar 27 23:10:01 EDT 2013


Author: jonathan
Date: 2013-03-27 23:10:01 -0400 (Wed, 27 Mar 2013)
New Revision: 560

Modified:
   libspreadutil/trunk/Changelog
   libspreadutil/trunk/src/alarm.c
   libspreadutil/trunk/src/arch.h
   libspreadutil/trunk/src/events.c
Log:
Apply windows portability fixes from Juan Pizzorno

Modified: libspreadutil/trunk/Changelog
===================================================================
--- libspreadutil/trunk/Changelog	2013-03-26 04:57:31 UTC (rev 559)
+++ libspreadutil/trunk/Changelog	2013-03-28 03:10:01 UTC (rev 560)
@@ -1,3 +1,7 @@
+Wed Mar 27 22:51:12 2013  Jonathan Stanton  <jonathan at spreadconcepts.com>
+
+	* arch.h, src/events.c, src/alarm.c: Windows portability fixes provided by Juan Pizzorno. 
+
 Tue Mar 12 07:08:28 2013  Jonathan Stanton  <jonathan at spreadconcepts.com>
 
 	* src/events.c (E_attach_fd): Change Alarm priority from PRINT to EVENTS so non-error FD attach 

Modified: libspreadutil/trunk/src/alarm.c
===================================================================
--- libspreadutil/trunk/src/alarm.c	2013-03-26 04:57:31 UTC (rev 559)
+++ libspreadutil/trunk/src/alarm.c	2013-03-28 03:10:01 UTC (rev 560)
@@ -45,6 +45,10 @@
 #  undef EAGAIN
 #  undef EWOULDBLOCK
 #  undef EINPROGRESS
+#  undef EALREADY
+#  ifndef va_copy
+#    define va_copy(d,s) (d) = (s)
+#  endif
 #endif
 #include <errno.h>
 
@@ -249,7 +253,9 @@
 
 #ifndef USE_THREADED_ALARM
         fprintf(stdout, "Exit caused by Alarm(EXIT)\n");
+#ifndef ARCH_PC_WIN95
         abort();
+#endif
         exit(0);
 #else
         Threaded_Alarm_Exit();
@@ -326,7 +332,9 @@
         if ( EXIT & mask )
         {
             printf("Exit caused by Alarm(EXIT)\n");
+#ifndef ARCH_PC_WIN95
             abort();
+#endif
             exit( 0 );
         }
 }
@@ -698,7 +706,9 @@
     }
 
     fprintf(stdout, "Exit caused by Alarm(EXIT)\n");
+#ifndef ARCH_PC_WIN95
     abort();
+#endif
     exit(0);
   }
 }

Modified: libspreadutil/trunk/src/arch.h
===================================================================
--- libspreadutil/trunk/src/arch.h	2013-03-26 04:57:31 UTC (rev 559)
+++ libspreadutil/trunk/src/arch.h	2013-03-28 03:10:01 UTC (rev 560)
@@ -124,8 +124,6 @@
 #define		ARCH_SCATTER_NONE
 #define		ARCH_ENDIAN	0x80000080
 #define         LOC_INLINE      
-typedef         unsigned long   sockopt_len_t;
-typedef         unsigned long   socklen_t;
 #define         BADCLOCK
 #define         HAVE_GOOD_VARGS
 /* Windows now has a strerror function and if we do not use it 
@@ -146,6 +144,12 @@
  * can be raised by defining a larger constant before including windows.h winsock.h
  */
 #define         FD_SETSIZE      1024
+
+#include <ws2tcpip.h>   /* after definition of FD_SETSIZE! */
+
+#define         HAVE_SOCKLEN_T 1
+typedef         int             sockopt_len_t;
+
 /* System location of spread.conf file */
 #define         SPREAD_ETCDIR   "/etc"
 /* Use winsock constants since we are dealing with sockets

Modified: libspreadutil/trunk/src/events.c
===================================================================
--- libspreadutil/trunk/src/events.c	2013-03-26 04:57:31 UTC (rev 559)
+++ libspreadutil/trunk/src/events.c	2013-03-28 03:10:01 UTC (rev 560)
@@ -44,6 +44,7 @@
 #undef EAGAIN
 #undef EWOULDBLOCK
 #undef EINPROGRESS
+#undef EALREADY
 #endif
 
 #include <errno.h>




More information about the Spread-cvs mailing list