Commits

Palmer, 2E0EOL committed 7c777dd

Allow mailall.c to be built when threads are not available.

Comments (0)

Files changed (1)

 #include <string.h>
 #include <limits.h>
 #include <time.h>
+
+#ifndef SERVER_THREADS
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif /*HAVE_UNISTD_H*/
+#endif /*SERVER_THREADS*/
+ 
 #ifdef HDRSTOP
 # pragma hdrstop
 #endif /*HDRSTOP*/
 #include "dlstdinc.h"
 
 #ifdef SERVER_THREADS
-# ifndef DAYBOTHREADS
-#  define DAYBOTHREADS
-# endif
-# ifdef SERVER_THREADS_NT
-#  ifndef DAYBOTHREADS_NT
-#   define DAYBOTHREADS_NT
-#  endif
-#  include <windows.h>
-# endif
-# ifdef SERVER_THREADS_PTH
-#  ifndef DAYBOTHREADS_PTH
-#   define DAYBOTHREADS_PTH
-#  endif
-#  include <pth.h>
-# endif
-# ifdef SERVER_THREADS_PTHREAD
-#  ifndef DAYBOTHREADS_PTHREAD
-#   define DAYBOTHREADS_PTHREAD
-#  endif
-#  include <pthread.h>
-#  include <errno.h>
-# endif
-#endif /*SERVER_THREADS*/
+# define DAYBOTHREADS_AUTO_INCLUDE
+# include "daybothreads.h"
+# define MAILALL_SLEEP(t) daybothreads_Sleep(t)
+#else
+# define MAILALL_SLEEP(t) sleep(t)
+#endif
 
-#include "daybothreads.h"
 #include "blake.h"
 
 static void Help(
       else
         BlakeError(err);
 
-      daybothreads_Sleep(20);
+      MAILALL_SLEEP(20);
     } while ( ++i );
 
     blake_db_UnlockTable(dbh);