projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hopefully fix the windows build to grovel time structures correctly.
[sbcl.git]
/
tools-for-build
/
grovel-headers.c
diff --git
a/tools-for-build/grovel-headers.c
b/tools-for-build/grovel-headers.c
index
9a3e74d
..
9be8744
100644
(file)
--- a/
tools-for-build/grovel-headers.c
+++ b/
tools-for-build/grovel-headers.c
@@
-31,6
+31,7
@@
#include <windows.h>
#include <shlobj.h>
#include <wincrypt.h>
#include <windows.h>
#include <shlobj.h>
#include <wincrypt.h>
+ #include <winsock2.h>
#undef boolean
#else
#include <poll.h>
#undef boolean
#else
#include <poll.h>
@@
-39,6
+40,7
@@
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <sys/termios.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <sys/termios.h>
+ #include <sys/time.h>
#include <langinfo.h>
#include <dlfcn.h>
#endif
#include <langinfo.h>
#include <dlfcn.h>
#endif
@@
-48,6
+50,7
@@
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
+#include <time.h>
#ifdef LISP_FEATURE_HPUX
#include <sys/bsdtty.h> /* for TIOCGPGRP */
#ifdef LISP_FEATURE_HPUX
#include <sys/bsdtty.h> /* for TIOCGPGRP */
@@
-58,12
+61,26
@@
#include <sys/sysctl.h>
#endif
#include <sys/sysctl.h>
#endif
+#ifdef _WIN32
+ #include "pthreads_win32.h"
+#endif
+
#include "wrap.h"
#include "gc.h"
#define DEFTYPE(lispname,cname) { cname foo; \
printf("(define-alien-type " lispname " (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); }
#include "wrap.h"
#include "gc.h"
#define DEFTYPE(lispname,cname) { cname foo; \
printf("(define-alien-type " lispname " (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); }
+#define DEFSTRUCT(lispname,cname,body) { cname bar; \
+ printf("(define-alien-type nil\n (struct %s", #lispname); \
+ body; \
+ printf("))\n"); }
+#define DEFSLOT(lispname,cname) \
+ printf("\n (%s (%s %d))", \
+ #lispname, \
+ (((bar.cname=-1)<0) ? "sb!alien:signed" : "unsigned"), \
+ (8 * (sizeof bar.cname)))
+
void
defconstant(char* lisp_name, unsigned long unix_number)
{
void
defconstant(char* lisp_name, unsigned long unix_number)
{
@@
-501,6
+518,15
@@
main(int argc, char *argv[])
#endif // !WIN32
printf("\n");
#endif // !WIN32
printf("\n");
+ printf(";;; structures\n");
+ DEFSTRUCT(timeval, struct timeval,
+ DEFSLOT(tv-sec, tv_sec);
+ DEFSLOT(tv-usec, tv_usec));
+ DEFSTRUCT(timespec, struct timespec,
+ DEFSLOT(tv-sec, tv_sec);
+ DEFSLOT(tv-nsec, tv_nsec));
+ printf("\n");
+
#ifdef LISP_FEATURE_BSD
printf(";;; sysctl(3) names\n");
printf("(in-package \"SB!IMPL\")\n");
#ifdef LISP_FEATURE_BSD
printf(";;; sysctl(3) names\n");
printf("(in-package \"SB!IMPL\")\n");