]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/io/ucln_io.c
ICU-511.31.tar.gz
[apple/icu.git] / icuSources / io / ucln_io.c
index 01a88e81c60ba680e1c2fef6b126a848ec4cde08..791a285c11b236754eb101a87522d23b49099eb1 100644 (file)
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *                                                                            *
-* Copyright (C) 2001-2006, International Business Machines                   *
+* Copyright (C) 2001-2011, International Business Machines                   *
 *                Corporation and others. All Rights Reserved.                *
 *                                                                            *
 ******************************************************************************
 #include "umutex.h"
 #include "uassert.h"
 
+#ifndef U_IO_IMPLEMENTATION
+#error U_IO_IMPLEMENTATION not set - must be set for all ICU source files in io/ - see http://userguide.icu-project.org/howtouseicu
+#endif
+
+
+/**  Auto-client */
+#define UCLN_TYPE UCLN_IO
+#include "ucln_imp.h"
+
 /* Leave this copyright notice here! It needs to go somewhere in this library. */
 static const char copyright[] = U_COPYRIGHT_STRING;
 
@@ -35,6 +44,9 @@ static UBool io_cleanup(void)
             gCleanupFunctions[libType] = NULL;
         }
     }
+#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
+    ucln_unRegisterAutomaticCleanup();
+#endif
     return TRUE;
 }
 
@@ -47,5 +59,9 @@ void ucln_io_registerCleanup(ECleanupIOType type,
     {
         gCleanupFunctions[type] = func;
     }
+
+#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
+    ucln_registerAutomaticCleanup();
+#endif
 }