libMisc_la_SOURCES =
libMisc_la_SOURCES += atomic.c
libMisc_la_SOURCES += base64.c
+libMisc_la_SOURCES += codeset.c
libMisc_la_SOURCES += codesetBase.c
libMisc_la_SOURCES += codesetOld.c
libMisc_la_SOURCES += dynarray.c
libMisc_la_SOURCES += strutil.c
libMisc_la_SOURCES += vthreadBase.c
-if HAVE_ICU
-libMisc_la_SOURCES += codeset.c
-endif
-
#include "vmware.h"
#include "vm_product.h"
#include "vm_atomic.h"
-#include "unicode/ucnv.h"
-#include "unicode/udata.h"
-#include "unicode/putil.h"
+#if !defined(NO_ICU)
+# include "unicode/ucnv.h"
+# include "unicode/udata.h"
+# include "unicode/putil.h"
+#endif
#include "file.h"
#include "util.h"
#include "codeset.h"
* Functions
*/
+#if !defined NO_ICU
+
#ifdef _WIN32
/*
#endif // _WIN32
+#endif // !NO_ICU
+
/*
*-----------------------------------------------------------------------------
CodeSet_Init(const char *icuDataDir) // IN: ICU data file location in Current code page.
// Default is used if NULL.
{
+#ifdef NO_ICU
+ /* Nothing required if not using ICU. */
+ return TRUE;
+#else // NO_ICU
DynBuf dbpath;
#ifdef _WIN32
DWORD attribs;
DynBuf_Destroy(&dbpath);
return ret;
+#endif
}
#endif /* defined(__APPLE__) */
-/*
- *-----------------------------------------------------------------------------
- *
- * CodeSet_GetCurrentCodeSet --
- *
- * Return native code set name. Always calls down to
- * CodeSetOld_GetCurrentCodeSet. See there for more details.
- *
- * Results:
- * See CodeSetOld_GetCurrentCodeSet.
- *
- * Side effects:
- * See CodeSetOld_GetCurrentCodeSet.
- *
- *-----------------------------------------------------------------------------
- */
-
-const char *
-CodeSet_GetCurrentCodeSet(void)
-{
- return CodeSetOld_GetCurrentCodeSet();
-}
-
-
/*
*-----------------------------------------------------------------------------
*
unsigned int flags, // IN
DynBuf *db) // IN/OUT
{
+#if defined(NO_ICU)
+ return CodeSetOld_GenericToGenericDb(codeIn, bufIn, sizeIn, codeOut,
+ flags, db);
+#else
Bool result = FALSE;
UErrorCode uerr;
const char *bufInCur;
}
return result;
+#endif
}
Bool
CodeSet_IsEncodingSupported(const char *name) // IN
{
+#if defined(NO_ICU)
+ return CodeSetOld_IsEncodingSupported(name);
+#else
UConverter *cv;
UErrorCode uerr;
}
return FALSE;
+#endif
}
size_t size, // IN: length of string
const char *code) // IN: encoding
{
+#if defined(NO_ICU)
+ return CodeSetOld_Validate(buf, size, code);
+#else
UConverter *cv;
UErrorCode uerr;
ucnv_close(cv);
return uerr == U_BUFFER_OVERFLOW_ERROR;
+#endif
}
#include <stdlib.h>
#include "vmware.h"
#include "codeset.h"
+#include "codesetOld.h"
#include "util.h"
+
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * CodeSet_GetCurrentCodeSet --
+ *
+ * Return native code set name. Always calls down to
+ * CodeSetOld_GetCurrentCodeSet. See there for more details.
+ *
+ * Results:
+ * See CodeSetOld_GetCurrentCodeSet.
+ *
+ * Side effects:
+ * See CodeSetOld_GetCurrentCodeSet.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+const char *
+CodeSet_GetCurrentCodeSet(void)
+{
+ return CodeSetOld_GetCurrentCodeSet();
+}
+
+
/*
*-----------------------------------------------------------------------------
*