X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b331163bffd790ced0e88b73f44f86d49ccc48a5..HEAD:/icuSources/common/icuplug.cpp diff --git a/icuSources/common/icuplug.cpp b/icuSources/common/icuplug.cpp index 2764ea5e..c6439cc8 100644 --- a/icuSources/common/icuplug.cpp +++ b/icuSources/common/icuplug.cpp @@ -1,3 +1,5 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * @@ -14,6 +16,11 @@ */ #include "unicode/icuplug.h" + + +#if UCONFIG_ENABLE_PLUGINS + + #include "icuplugimp.h" #include "cstring.h" #include "cmemory.h" @@ -307,6 +314,9 @@ static void uplug_queryPlug(UPlugData *plug, UErrorCode *status) { static void uplug_loadPlug(UPlugData *plug, UErrorCode *status) { + if(U_FAILURE(*status)) { + return; + } if(!plug->awaitingLoad || (plug->level < UPLUG_LEVEL_LOW) ) { /* shouldn't happen. Plugin hasn'tbeen loaded yet.*/ *status = U_INTERNAL_PROGRAM_ERROR; return; @@ -352,13 +362,11 @@ static UPlugData *uplug_allocateEmptyPlug(UErrorCode *status) static UPlugData *uplug_allocatePlug(UPlugEntrypoint *entrypoint, const char *config, void *lib, const char *symName, UErrorCode *status) { - UPlugData *plug; - + UPlugData *plug = uplug_allocateEmptyPlug(status); if(U_FAILURE(*status)) { return NULL; } - plug = uplug_allocateEmptyPlug(status); if(config!=NULL) { uprv_strncpy(plug->config, config, UPLUG_NAME_MAX); } else { @@ -870,3 +878,7 @@ uplug_init(UErrorCode *status) { gCurrentLevel = UPLUG_LEVEL_HIGH; ucln_registerCleanup(UCLN_UPLUG, uplug_cleanup); } + +#endif + +