Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 13385) +++ trunk/config.h.in (revision 13386) @@ -48,6 +48,12 @@ print {\n\n/* Wether setenv() works */\n} print_ternary ?libs/env/setenv/presents {#define PCB_HAVE_SETENV 1} {/* #undef PCB_HAVE_SETENV */} +print {\n\n/* Wether usleep() works */\n} +print_ternary ?libs/time/usleep/presents {#define PCB_HAVE_USLEEP 1} {/* #undef PCB_HAVE_USLEEP */} + +print {\n\n/* Wether win32 Sleep() works */\n} +print_ternary ?libs/time/Sleep/presents {#define PCB_HAVE_WSLEEP 1} {/* #undef PCB_HAVE_WSLEEP */} + print {\n\n/* Define to 1 if you have the `snprintf' function. */\n} print_ternary ?libs/snprintf {#define HAVE_SNPRINTF 1} {/* #undef HAVE_SNPRINTF */} Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 13385) +++ trunk/scconfig/Rev.h (revision 13386) @@ -1 +1 @@ -static const int myrev = 13383; +static const int myrev = 13386; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 13385) +++ trunk/scconfig/Rev.tab (revision 13386) @@ -1,4 +1,4 @@ -13383 configure proper detection of includes for fileno() +13386 configure proper detection of includes for fileno() and usleep() 13364 configure new plugin: extedit 13269 configure remove free_atexit 13171 configure io_eagle: new source file for parsing dru files Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 13385) +++ trunk/scconfig/hooks.c (revision 13386) @@ -370,6 +370,11 @@ require("libs/math/round/*", 0, 0); require("libs/userpass/getpwuid/*", 0, 0); + if (require("libs/time/usleep/*", 0, 0) && require("libs/time/Sleep/*", 0, 0)) { + report_repeat("\nERROR: can not find usleep() or Sleep() - no idea how to sleep ms.\n\n"); + return 1; + } + if (require("libs/ldl", 0, 0) != 0) { if (require("libs/LoadLibrary", 0, 0) != 0) { report_repeat("\nERROR: no dynamic linking found on your system. Can not compile pcb-rnd.\n\n"); Index: trunk/src/compat_inc.h.in =================================================================== --- trunk/src/compat_inc.h.in (revision 13385) +++ trunk/src/compat_inc.h.in (revision 13386) @@ -17,6 +17,8 @@ @?/target/libs/env/setenv/includes@ @?/target/libs/fs/readdir/includes@ @?/target/libs/io/fileno/includes@ +@?/target/libs/time/Sleep/includes@ +@?/target/libs/time/usleep/includes@ @] put /tmpasm/IFS {\n} @@ -27,7 +29,7 @@ print [@ /*** DO NOT EDIT - automatically generated by scconfig ***/ -#define _XOPEN_SOURCE +#define _XOPEN_SOURCE 500 /* system-dependent includes, as detected in ./configure */ Index: trunk/src/compat_misc.c =================================================================== --- trunk/src/compat_misc.c (revision 13385) +++ trunk/src/compat_misc.c (revision 13386) @@ -184,8 +184,15 @@ void pcb_ms_sleep(long ms) { -#warning TODO: scconfig detection, port to windows +#ifdef PCB_HAVE_USLEEP usleep(ms*1000); +#else +# ifdef PCB_HAVE_WSLEEP + Sleep(ms); +# else +# error pcb_ms_sleep(): no milisecond sleep on this host. +# endif +#endif } int pcb_fileno(FILE *f)