From 0cadb8f061153843c70125bd7b1b1b61b4d3d221 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 18 Jun 2004 23:43:47 +0000 Subject: [PATCH] * k5-platform.h (MAKE_INIT_FUNCTION, CALL_INIT_FUNCTION, INITIALIZER_RAN): Use the linker-driven version for Windows. The auxinit function definition needs an argument list. (MAKE_FINI_FUNCTION): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16488 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 5 +++++ src/include/k5-platform.h | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 403392748..4bb1de8e6 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,10 @@ 2004-06-18 Ken Raeburn + * k5-platform.h (MAKE_INIT_FUNCTION, CALL_INIT_FUNCTION, + INITIALIZER_RAN): Use the linker-driven version for Windows. The + auxinit function definition needs an argument list. + (MAKE_FINI_FUNCTION): Likewise. + * win-mac.h (HAVE_STRERROR, SYS_ERRLIST_DECLARED): Define. 2004-06-16 Ken Raeburn diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index 04cc276a1..7343e5c53 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -240,15 +240,16 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; : (abort(),0)) # define INITIALIZER_RAN(NAME) (JOIN2(NAME,__ran).did_run == 3 && JOIN2(NAME, __ran).error == 0) -#elif defined(USE_LINKER_INIT_OPTION) +#elif defined(USE_LINKER_INIT_OPTION) || defined(_WIN32) -/* Run initializer at load time, via linker magic. */ +/* Run initializer at load time, via linker magic, or in the + case of WIN32, win_glue.c hard-coded knowledge. */ typedef struct { int error; unsigned char did_run; } k5_init_t; # define MAKE_INIT_FUNCTION(NAME) \ static k5_init_t JOIN2(NAME, __ran) \ = { 0, 2 }; \ static int NAME(void); \ - void JOIN2(NAME, __auxinit) \ + void JOIN2(NAME, __auxinit)() \ { \ JOIN2(NAME, __ran).error = NAME(); \ JOIN2(NAME, __ran).did_run = 3; \ @@ -273,7 +274,7 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; -#ifdef USE_LINKER_FINI_OPTION +#if defined(USE_LINKER_FINI_OPTION) || defined(_WIN32) /* If we're told the linker option will be used, it doesn't really matter what compiler we're using. Do it the same way regardless. */ @@ -281,7 +282,7 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; # define MAKE_FINI_FUNCTION(NAME) \ void NAME(void) -#elif defined(__GNUC__) && !defined(_WIN32) && defined(DESTRUCTOR_ATTR_WORKS) +#elif defined(__GNUC__) && defined(DESTRUCTOR_ATTR_WORKS) /* If we're using gcc, if the C++ support works, the compiler should build executables and shared libraries that support the use of static constructors and destructors. The C compiler supports a -- 2.26.2