Index: /trunk/src/emx/include/uconv.h
===================================================================
--- /trunk/src/emx/include/uconv.h	(revision 230)
+++ /trunk/src/emx/include/uconv.h	(revision 231)
@@ -98,14 +98,14 @@
 typedef void *UconvObject;
 
-int UniCreateUconvObject (UniChar *codepage, UconvObject *uobj);
-int UniQueryUconvObject (UconvObject uobj, uconv_attribute_t * attr,
+int APIENTRY UniCreateUconvObject (UniChar *codepage, UconvObject *uobj);
+int APIENTRY UniQueryUconvObject (UconvObject uobj, uconv_attribute_t * attr,
   size_t size, char first [256], char other [256], udcrange_t udcrange[32]);
-int UniSetUconvObject (UconvObject uobj, uconv_attribute_t * attr);
-int UniUconvToUcs (UconvObject uobj, void **inbuf, size_t *inbytes,
+int APIENTRY UniSetUconvObject (UconvObject uobj, uconv_attribute_t * attr);
+int APIENTRY UniUconvToUcs (UconvObject uobj, void **inbuf, size_t *inbytes,
   UniChar **outbuf, size_t *outchars, size_t *subst);
-int UniUconvFromUcs (UconvObject uobj, UniChar **inbuf, size_t *inchars,
+int APIENTRY UniUconvFromUcs (UconvObject uobj, UniChar **inbuf, size_t *inchars,
   void **outbuf, size_t *outbytes, size_t *subst);
-int UniFreeUconvObject (UconvObject uobj);
-int UniMapCpToUcsCp (unsigned long ulCodePage, UniChar *ucsCodePage, size_t n);
+int APIENTRY UniFreeUconvObject (UconvObject uobj);
+int APIENTRY UniMapCpToUcsCp (unsigned long ulCodePage, UniChar *ucsCodePage, size_t n);
 
 #define IBM_437         (UniChar *)L"IBM-437"
@@ -116,4 +116,16 @@
 #define ISO8859_1       (UniChar *)L"IBM-819"
 
+/* uconv error aliases. */
+#define UCONV_BADATTR           ULS_BADATTR
+#define UCONV_E2BIG             ULS_BUFFERFULL
+#define UCONV_EBADF             ULS_BADOBJECT
+#define UCONV_EILSEQ            ULS_ILLEGALSEQUENCE
+#define UCONV_EINVAL            ULS_INVALID
+#define UCONV_EMFILE            ULS_MAXFILESPERPROC
+#define UCONV_ENFILE            ULS_MAXFILES
+#define UCONV_ENOMEM            ULS_NOMEMORY
+#define UCONV_EOTHER            ULS_OTHER
+#define UCONV_NOTIMPLEMENTED    ULS_NOTIMPLEMENTED
+
 #ifdef __cplusplus
 }
Index: /trunk/src/emx/include/ulserrno.h
===================================================================
--- /trunk/src/emx/include/ulserrno.h	(revision 230)
+++ /trunk/src/emx/include/ulserrno.h	(revision 231)
@@ -43,3 +43,4 @@
 } uls_error_t;
 
+
 #endif /* __ULSERRNO_H__ */
Index: /trunk/src/emx/include/unidef.h
===================================================================
--- /trunk/src/emx/include/unidef.h	(revision 230)
+++ /trunk/src/emx/include/unidef.h	(revision 231)
@@ -36,4 +36,7 @@
 #ifndef FALSE
 # define FALSE	0
+#endif
+#ifndef APIENTRY
+#define APIENTRY _System
 #endif
 
@@ -91,102 +94,102 @@
 /* Locale Management Function Prototypes */
 
-int UniCreateLocaleObject (int locale_spec_type, const void *locale_spec,
+int APIENTRY UniCreateLocaleObject (int locale_spec_type, const void *locale_spec,
   LocaleObject *locale_object_ptr);
-int UniQueryLocaleObject (const LocaleObject locale_object, int category,
+int APIENTRY UniQueryLocaleObject (const LocaleObject locale_object, int category,
   int locale_spec_type, void **locale_spec_ptr);
-int UniFreeLocaleObject (LocaleObject locale_object);
-int UniFreeMem (void *memory_ptr);
-int UniLocaleStrToToken (int locale_string_type, const void *locale_string,
+int APIENTRY UniFreeLocaleObject (LocaleObject locale_object);
+int APIENTRY UniFreeMem (void *memory_ptr);
+int APIENTRY UniLocaleStrToToken (int locale_string_type, const void *locale_string,
   LocaleToken *locale_token_ptr);
-int UniLocaleTokenToStr (const LocaleToken locale_token,
+int APIENTRY UniLocaleTokenToStr (const LocaleToken locale_token,
   int locale_string_type, void **locale_string_ptr);
 
 /* Locale Information Function Prototypes */
-int UniQueryLocaleInfo (const LocaleObject locale_object,
+int APIENTRY UniQueryLocaleInfo (const LocaleObject locale_object,
   struct UniLconv **unilconv_addr_ptr);
-int UniFreeLocaleInfo (struct UniLconv *unilconv_addr);
-int UniQueryLocaleItem (const LocaleObject locale_object, LocaleItem item,
+int APIENTRY UniFreeLocaleInfo (struct UniLconv *unilconv_addr);
+int APIENTRY UniQueryLocaleItem (const LocaleObject locale_object, LocaleItem item,
   UniChar **info_item_addr_ptr);
 
 /* Date and Time Function Prototypes */
-size_t UniStrftime (const LocaleObject locale_object, UniChar *ucs,
+size_t APIENTRY UniStrftime (const LocaleObject locale_object, UniChar *ucs,
   size_t maxsize, const UniChar *format, const struct tm *time_ptr);
-UniChar *UniStrptime (const LocaleObject locale_object, const UniChar *buf,
+UniChar *APIENTRY UniStrptime (const LocaleObject locale_object, const UniChar *buf,
   const UniChar *format, struct tm *time_ptr);
 
 /* Monetary Formatting Function Prototype */
-int UniStrfmon (const LocaleObject locale_object, UniChar *ucs, size_t maxsize,
+int APIENTRY UniStrfmon (const LocaleObject locale_object, UniChar *ucs, size_t maxsize,
   const UniChar *format, ...);
 
 /* String/Character Function Prototypes */
-UniChar *UniStrcat (UniChar *ucs1, const UniChar *ucs2);
-UniChar *UniStrchr (const UniChar *ucs, UniChar uc);
-int UniStrcmp (const UniChar *ucs1, const UniChar *ucs2);
-UniChar *UniStrcpy (UniChar *ucs1, const UniChar *ucs2);
-size_t UniStrcspn (const UniChar *ucs1, const UniChar *ucs2);
-size_t UniStrlen (const UniChar *ucs1);
-UniChar *UniStrncat (UniChar *ucs1, const UniChar *ucs2, size_t n);
-int UniStrncmp (const UniChar *ucs1, const UniChar *ucs2, size_t n);
-UniChar *UniStrncpy (UniChar *ucs1, const UniChar *ucs2, size_t n);
-UniChar *UniStrpbrk (const UniChar *ucs1, const UniChar *ucs2);
-UniChar *UniStrrchr (const UniChar *ucs, UniChar uc);
-size_t UniStrspn (const UniChar *ucs1, const UniChar *ucs2);
-UniChar *UniStrstr (const UniChar *ucs1, const UniChar *ucs2);
-UniChar *UniStrtok (UniChar *ucs1, const UniChar *ucs2);
+UniChar *APIENTRY UniStrcat (UniChar *ucs1, const UniChar *ucs2);
+UniChar *APIENTRY UniStrchr (const UniChar *ucs, UniChar uc);
+int APIENTRY UniStrcmp (const UniChar *ucs1, const UniChar *ucs2);
+UniChar *APIENTRY UniStrcpy (UniChar *ucs1, const UniChar *ucs2);
+size_t APIENTRY UniStrcspn (const UniChar *ucs1, const UniChar *ucs2);
+size_t APIENTRY UniStrlen (const UniChar *ucs1);
+UniChar *APIENTRY UniStrncat (UniChar *ucs1, const UniChar *ucs2, size_t n);
+int APIENTRY UniStrncmp (const UniChar *ucs1, const UniChar *ucs2, size_t n);
+UniChar *APIENTRY UniStrncpy (UniChar *ucs1, const UniChar *ucs2, size_t n);
+UniChar *APIENTRY UniStrpbrk (const UniChar *ucs1, const UniChar *ucs2);
+UniChar *APIENTRY UniStrrchr (const UniChar *ucs, UniChar uc);
+size_t APIENTRY UniStrspn (const UniChar *ucs1, const UniChar *ucs2);
+UniChar *APIENTRY UniStrstr (const UniChar *ucs1, const UniChar *ucs2);
+UniChar *APIENTRY UniStrtok (UniChar *ucs1, const UniChar *ucs2);
 
 /* Character Attribute Function Prototypes */
-int UniCreateAttrObject (const LocaleObject locale_object,
+int APIENTRY UniCreateAttrObject (const LocaleObject locale_object,
   const UniChar *attr_name, AttrObject *attr_object_ptr);
-int UniQueryCharAttr (AttrObject attr_object, UniChar uc);
-int UniScanForAttr (AttrObject attr_object, const UniChar *ucs,
+int APIENTRY UniQueryCharAttr (AttrObject attr_object, UniChar uc);
+int APIENTRY UniScanForAttr (AttrObject attr_object, const UniChar *ucs,
   size_t num_elems, ulsBool inverse_op, size_t *offset_ptr);
-int UniFreeAttrObject (AttrObject attr_object);
-int UniQueryAlnum (const LocaleObject locale_object, UniChar uc);
-int UniQueryAlpha (const LocaleObject locale_object, UniChar uc);
-int UniQueryBlank (const LocaleObject locale_object, UniChar uc);
-int UniQueryCntrl (const LocaleObject locale_object, UniChar uc);
-int UniQueryDigit (const LocaleObject locale_object, UniChar uc);
-int UniQueryGraph (const LocaleObject locale_object, UniChar uc);
-int UniQueryLower (const LocaleObject locale_object, UniChar uc);
-int UniQueryPrint (const LocaleObject locale_object, UniChar uc);
-int UniQueryPunct (const LocaleObject locale_object, UniChar uc);
-int UniQuerySpace (const LocaleObject locale_object, UniChar uc);
-int UniQueryUpper (const LocaleObject locale_object, UniChar uc);
-int UniQueryXdigit (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniFreeAttrObject (AttrObject attr_object);
+int APIENTRY UniQueryAlnum (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryAlpha (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryBlank (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryCntrl (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryDigit (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryGraph (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryLower (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryPrint (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryPunct (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQuerySpace (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryUpper (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniQueryXdigit (const LocaleObject locale_object, UniChar uc);
 
 /* String Transformation Function Prototypes */
-int UniCreateTransformObject (const LocaleObject locale_object,
+int APIENTRY UniCreateTransformObject (const LocaleObject locale_object,
   const UniChar *xtype, XformObject *xform_object_ptr);
-int UniTransformStr (XformObject xform_object, const UniChar *inp_buf,
+int APIENTRY UniTransformStr (XformObject xform_object, const UniChar *inp_buf,
   int *inp_size, UniChar *out_buf, int *out_size);
-int UniFreeTransformObject (XformObject xform_object);
-UniChar UniTransLower (const LocaleObject locale_object, UniChar uc);
-UniChar UniTransUpper (const LocaleObject locale_object, UniChar uc);
+int APIENTRY UniFreeTransformObject (XformObject xform_object);
+UniChar APIENTRY UniTransLower (const LocaleObject locale_object, UniChar uc);
+UniChar APIENTRY UniTransUpper (const LocaleObject locale_object, UniChar uc);
 
 /* String Conversion Function Prototypes */
-int UniStrtod (const LocaleObject locale_object, const UniChar *ucs,
+int APIENTRY UniStrtod (const LocaleObject locale_object, const UniChar *ucs,
   UniChar **end_ptr, double *result_ptr);
-int UniStrtol (const LocaleObject locale_object, const UniChar *ucs,
+int APIENTRY UniStrtol (const LocaleObject locale_object, const UniChar *ucs,
   UniChar **end_ptr, int base, long int *result_ptr);
-int UniStrtoul (const LocaleObject locale_object, const UniChar *ucs,
+int APIENTRY UniStrtoul (const LocaleObject locale_object, const UniChar *ucs,
   UniChar **end_ptr, int base, unsigned long int *result_ptr);
 
 /* String Comparison Function Prototypes */
-int UniStrcoll (const LocaleObject locale_object,
+int APIENTRY UniStrcoll (const LocaleObject locale_object,
   const UniChar *ucs1, const UniChar *ucs2);
-size_t UniStrxfrm (const LocaleObject locale_object, UniChar *ucs1,
+size_t APIENTRY UniStrxfrm (const LocaleObject locale_object, UniChar *ucs1,
   const UniChar *ucs2, size_t n);
-int UniStrcmpi (const LocaleObject locale_object,
+int APIENTRY UniStrcmpi (const LocaleObject locale_object,
   const UniChar *ucs1, const UniChar *ucs2);
-int UniStrncmpi (const LocaleObject locale_object,
+int APIENTRY UniStrncmpi (const LocaleObject locale_object,
   const UniChar *ucs1, const UniChar *ucs2, const size_t n);
 
 /* Unicode Case Mapping Function Prototypes */
-UniChar UniToupper (UniChar uc);
-UniChar UniTolower (UniChar uc);
-UniChar *UniStrupr (UniChar *ucs);
-UniChar *UniStrlwr (UniChar *ucs);
+UniChar APIENTRY UniToupper (UniChar uc);
+UniChar APIENTRY UniTolower (UniChar uc);
+UniChar *APIENTRY UniStrupr (UniChar *ucs);
+UniChar *APIENTRY UniStrlwr (UniChar *ucs);
 
-int UniMapCtryToLocale (unsigned long Country, UniChar *LocaleName, size_t n);
+int APIENTRY UniMapCtryToLocale (unsigned long Country, UniChar *LocaleName, size_t n);
 
 #ifdef __cplusplus
