diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:27 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:27 -0800 |
commit | c7d035ae1a729232579a0fe41ed5affa131d3623 (patch) | |
tree | fb387f7c2a8e01cf603d4c75fbbaa68f711df986 /scmmain.c | |
parent | deda2c0fd8689349fea2a900199a76ff7ecb319e (diff) | |
download | scm-c7d035ae1a729232579a0fe41ed5affa131d3623.tar.gz scm-c7d035ae1a729232579a0fe41ed5affa131d3623.zip |
Import Upstream version 5d9upstream/5d9
Diffstat (limited to 'scmmain.c')
-rw-r--r-- | scmmain.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -47,12 +47,19 @@ # include <floatingpoint.h> #endif +#ifdef _WIN32 +# include <io.h> +#endif + #include "scm.h" #include "patchlvl.h" #ifdef __IBMC__ # include <io.h> #endif +#ifdef __NetBSD__ +# include <unistd.h> +#endif #ifdef __OpenBSD__ # include <unistd.h> #endif @@ -68,6 +75,7 @@ char *scm_find_implpath(execpath) { char *implpath = 0; #ifndef nosve +# ifndef POCKETCONSOLE char *getenvpath = getenv(INIT_GETENV); /* fprintf(stderr, "%s=%s\n", INIT_GETENV, getenvpath); fflush(stderr); */ if (getenvpath) implpath = scm_cat_path(0L, getenvpath, 0L); @@ -80,6 +88,7 @@ char *scm_find_implpath(execpath) fputs("\") not found; Trying elsewhere\n", stderr); } } +# endif #endif if (!implpath && execpath) implpath = find_impl_file(execpath, GENERIC_NAME, INIT_FILE_NAME, dirsep); @@ -90,6 +99,12 @@ char *scm_find_implpath(execpath) } char *generic_name[] = { GENERIC_NAME }; +#ifdef WINSIGNALS +SCM_EXPORT HANDLE scm_hMainThread; +#endif + +void scmmain_init_user_scm(); + int main(argc, argv) int argc; char **argv; @@ -102,10 +117,19 @@ int main(argc, argv) #ifdef __FreeBSD__ fp_prec_t fpspec; #endif + +#ifdef WINSIGNALS + /* need a handle to access the main thread from the signal handler thread */ + DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), + &scm_hMainThread, 0, TRUE, DUPLICATE_SAME_ACCESS); +#endif + /* {char ** argvv = argv; */ /* for (;*argvv;argvv++) {fputs(*argvv, stderr); fputs(" ", stderr);} */ /* fputs("\n", stderr);} */ + init_user_scm = scmmain_init_user_scm; + if (0==argc) {argc = 1; argv = generic_name;} /* for macintosh */ #ifndef LACK_SBRK init_sbrk(); /* Do this before malloc()s. */ @@ -162,7 +186,7 @@ int main(argc, argv) /* init_user_scm() is called by the scheme procedure SCM_INIT_EXTENSIONS in "Init5xx.scm" */ -void init_user_scm() +void scmmain_init_user_scm() { /* Put calls to your C initialization routines here. */ } |