/** * Auto cleanup of ICU libraries * There are several methods in per library cleanup of icu libraries: * 1) Compiler/Platform based cleanup: * a) Windows MSVC uses DllMain() * b) GCC uses destructor function attribute * c) Sun Studio, AIX VA, and HP-UX aCC uses a linker option to set the exit function * 2) Using atexit() * 3) Implementing own automatic cleanup functions * * For option 1, ensure that UCLN_NO_AUTO_CLEANUP is set to 0 by using --enable-auto-cleanup * configure option or by otherwise setting UCLN_NO_AUTO_CLEANUP to 0 * For option 2, follow option 1 and also define UCLN_AUTO_ATEXIT * For option 3, follow option 1 and also define UCLN_AUTO_LOCAL (see below for more information)
*/
#if !UCLN_NO_AUTO_CLEANUP
/* * The following declarations are for when UCLN_AUTO_LOCAL or UCLN_AUTO_ATEXIT * are defined. They are commented out because they are static and will be defined * later. The information is still here to provide some guidance for the developer * who chooses to use UCLN_AUTO_LOCAL.
*/ /** * Give the library an opportunity to register an automatic cleanup. * This may be called more than once.
*/ /*static void ucln_registerAutomaticCleanup();*/ /** * Unregister an automatic cleanup, if possible. Called from cleanup.
*/ /*static void ucln_unRegisterAutomaticCleanup();*/
#elifdefined(UCLN_AUTO_ATEXIT) /* * Use the ANSI C 'atexit' function. Note that this mechanism does not * guarantee the order of cleanup relative to other users of ICU!
*/ static UBool gAutoCleanRegistered = false;
#elifdefined (UCLN_FINI) /** * If UCLN_FINI is defined, it is the (versioned, etc) name of a cleanup * entrypoint. Add a stub to call ucln_cleanupOne * Used on AIX, Solaris, and HP-UX
*/
U_CAPI void U_EXPORT2 UCLN_FINI (void);
U_CAPI void U_EXPORT2 UCLN_FINI ()
{ /* This function must be defined, if UCLN_FINI is defined, else link error. */
UCLN_CLEAN_ME_UP;
}
/* these are from putil.c */ /* READ READ READ READ! Are you getting compilation errors from windows.h? Any source file which includes this (ucln_imp.h) header MUST
be defined with language extensions ON. */ #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN #endif # define VC_EXTRALEAN # define NOUSER # define NOSERVICE # define NOIME # define NOMCX # include <windows.h> /* * This is a stub DllMain function with icu specific process handling code.
*/ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ BOOL status = true;
switch(fdwReason) { case DLL_PROCESS_ATTACH: /* ICU does not trap process attach, but must pass these through properly. */ /* ICU specific process attach could go here */ break;
case DLL_PROCESS_DETACH: /* Here is the one we actually care about. */
UCLN_CLEAN_ME_UP;
break;
case DLL_THREAD_ATTACH: /* ICU does not trap thread attach, but must pass these through properly. */ /* ICU specific thread attach could go here */ break;
case DLL_THREAD_DETACH: /* ICU does not trap thread detach, but must pass these through properly. */ /* ICU specific thread detach could go here */ break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.