From: Nikodemus S. <de...@us...> - 2006-06-20 05:38:49
|
Update of /cvsroot/sbcl/sbcl/src/runtime In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4437/src/runtime Modified Files: globals.h runtime.c time.c Log Message: 0.9.13.50: Windows baby-steps * Less sucky toplevel-init: use PARSE-NATIVE-NAMESTRING to deal with user-supplied init-file names, and refactor the logic between Posix and Windows. * New runtime option: --debug-environment, prints out the command line arguments and environment before anything fancy gets done to them. Good for debugging startup from Windows shortcuts, etc. * Less magic constants, more groveled stuff. * SB-WIN32::GET-FOLDER-PATH renamed to SB-WIN32::GET-FOLDER-PATHNAME, and it now returns pathnames instead of strings. * Add internal function SBCL-HOMEDIR-PATHNAME, and centralize the SBCL_HOME stuff there. * Still LESS_SHOUTING. * Move stuff-groveled-from-headers.lisp earlier in the build-order, so toplevel.lisp can use it. * No localtime_r and gmtime_r on Windows. Index: globals.h =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/globals.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- globals.h 21 Feb 2006 22:59:33 -0000 1.26 +++ globals.h 20 Jun 2006 05:38:43 -0000 1.27 @@ -24,6 +24,13 @@ extern int foreign_function_call_active; extern boolean stop_the_world; +#ifdef LISP_FEATURE_WIN32 +#define ENVIRON _environ +#else +#define ENVIRON environ +#endif +extern char **ENVIRON; + #if defined(LISP_FEATURE_SB_THREAD) extern pthread_key_t specials; #endif Index: runtime.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/runtime.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- runtime.c 7 Jun 2006 16:25:10 -0000 1.59 +++ runtime.c 20 Jun 2006 05:38:43 -0000 1.60 @@ -271,6 +271,20 @@ /* As in "--help" case, I think this is expected. */ print_version(); exit(0); + } else if (0 == strcmp(arg, "--debug-environment")) { + int n = 0; + printf("; Commandline arguments:\n"); + while (n < argc) { + printf("; %2d: \"%s\"\n", n, argv[n]); + ++n; + } + n = 0; + printf(";\n; Environment:\n"); + while (ENVIRON[n]) { + printf("; %2d: \"%s\"\n", n, ENVIRON[n]); + ++n; + } + ++argi; } else if (0 == strcmp(arg, "--end-runtime-options")) { end_runtime_options = 1; ++argi; Index: time.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/time.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- time.c 18 Jun 2006 23:47:58 -0000 1.6 +++ time.c 20 Jun 2006 05:38:43 -0000 1.7 @@ -23,8 +23,17 @@ struct tm ltm, gtm; int sw; +#ifdef LISP_FEATURE_WIN32 + /* No _r versions on Windows, but the API documentation also + * doesn't warn them about being non-reentrant... So here's + * hoping they actually are -- once Windows grows threads + * this better be checked, though. */ + ltm = *localtime(&when); + gtm = *gmtime(&when); +#else ltm = *localtime_r(&when, <m); gtm = *gmtime_r(&when, >m); +#endif sw = (((gtm.tm_hour*60)+gtm.tm_min)*60+gtm.tm_sec) - (((ltm.tm_hour*60)+ltm.tm_min)*60+ltm.tm_sec); if ((gtm.tm_wday + 1) % 7 == ltm.tm_wday) |