]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/icuplug.cpp
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / common / icuplug.cpp
index 2764ea5ee0560fb733f01b7471d12e6a5918e7fb..bca7798e9f789b3c6870d1aa2340ef731a6fcdc3 100644 (file)
 */
 
 #include "unicode/icuplug.h"
 */
 
 #include "unicode/icuplug.h"
+
+
+#if UCONFIG_ENABLE_PLUGINS
+
+
 #include "icuplugimp.h"
 #include "cstring.h"
 #include "cmemory.h"
 #include "icuplugimp.h"
 #include "cstring.h"
 #include "cmemory.h"
@@ -307,6 +312,9 @@ static void uplug_queryPlug(UPlugData *plug, UErrorCode *status) {
 
 
 static void uplug_loadPlug(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;
   if(!plug->awaitingLoad || (plug->level < UPLUG_LEVEL_LOW) ) {  /* shouldn't happen. Plugin hasn'tbeen loaded yet.*/
     *status = U_INTERNAL_PROGRAM_ERROR;
     return;
@@ -352,13 +360,11 @@ static UPlugData *uplug_allocateEmptyPlug(UErrorCode *status)
 
 static UPlugData *uplug_allocatePlug(UPlugEntrypoint *entrypoint, const char *config, void *lib, const char *symName,
                                      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;
   }
 
   if(U_FAILURE(*status)) {
     return NULL;
   }
 
-  plug = uplug_allocateEmptyPlug(status);
   if(config!=NULL) {
     uprv_strncpy(plug->config, config, UPLUG_NAME_MAX);
   } else {
   if(config!=NULL) {
     uprv_strncpy(plug->config, config, UPLUG_NAME_MAX);
   } else {
@@ -870,3 +876,7 @@ uplug_init(UErrorCode *status) {
   gCurrentLevel = UPLUG_LEVEL_HIGH;
   ucln_registerCleanup(UCLN_UPLUG, uplug_cleanup);
 }
   gCurrentLevel = UPLUG_LEVEL_HIGH;
   ucln_registerCleanup(UCLN_UPLUG, uplug_cleanup);
 }
+
+#endif
+
+