diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2004-06-18 23:43:47 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2004-06-18 23:43:47 +0000 |
| commit | 0cadb8f061153843c70125bd7b1b1b61b4d3d221 (patch) | |
| tree | f09a9e35317be61b9eb48b68f3bc4b35a7805293 /src/include/k5-platform.h | |
| parent | 3a0d951baf94470687a3e1b88a14301273ad1a9d (diff) | |
| download | krb5-0cadb8f061153843c70125bd7b1b1b61b4d3d221.tar.gz krb5-0cadb8f061153843c70125bd7b1b1b61b4d3d221.tar.xz krb5-0cadb8f061153843c70125bd7b1b1b61b4d3d221.zip | |
* 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
Diffstat (limited to 'src/include/k5-platform.h')
| -rw-r--r-- | src/include/k5-platform.h | 11 |
1 files changed, 6 insertions, 5 deletions
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 |
