[uim-commit] r636 - in trunk: . uim xim

ekato at freedesktop.org ekato at freedesktop.org
Sat Feb 12 18:10:27 PST 2005


Author: ekato
Date: 2005-02-12 18:10:24 -0800 (Sat, 12 Feb 2005)
New Revision: 636

Modified:
   trunk/configure.ac
   trunk/uim/strsep.c
   trunk/uim/uim-helper.c
   trunk/uim/uim-ipc.c
   trunk/xim/locale.cpp
   trunk/xim/util.cpp
   trunk/xim/util.h
Log:
* Fix compilation on Solaris8, thanks to Konosuke Watanabe.
* configure.ac : Add check for sig_t.
* uim/uim-ipc.c : If strsep doesn't exist, use uim_strsep.
* uim/uim-helper.c : Include "config.h" and check typedef sig_t
  if it doesn't exist.
* uim/strsep.c : Rename strsep into uim_strsep.
* xim/locale.cpp : Add sanity check.
* xim/util.h : If strsep doesn't exist, use uim_strsep.
* xim/util.cpp : Fix vasprintf on Solaris8.


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/configure.ac	2005-02-13 02:10:24 UTC (rev 636)
@@ -153,6 +153,9 @@
 AC_CHECK_HEADERS([curses.h stropts.h])
 AC_CHECK_HEADERS([sys/param.h strings.h])
 
+# Check for type
+AC_CHECK_TYPES(sig_t)
+
 # Checks for library
 AC_CHECK_LIB(dl,dlopen)
 AC_CHECK_LIB(socket,socket)

Modified: trunk/uim/strsep.c
===================================================================
--- trunk/uim/strsep.c	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/uim/strsep.c	2005-02-13 02:10:24 UTC (rev 636)
@@ -45,7 +45,7 @@
  * If *stringp is NULL, strsep returns NULL.
  */
 char *
-strsep(char **stringp, const char *delim)
+uim_strsep(char **stringp, const char *delim)
 {
 	char *s;
 	const char *spanp;

Modified: trunk/uim/uim-helper.c
===================================================================
--- trunk/uim/uim-helper.c	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/uim/uim-helper.c	2005-02-13 02:10:24 UTC (rev 636)
@@ -31,6 +31,8 @@
 
 */
 
+#include "config.h"
+
 #include <unistd.h>
 #include <sys/socket.h>
 #include <sys/types.h>
@@ -47,6 +49,10 @@
 #include "context.h"
 #include "uim-helper.h"
 
+#ifndef HAVE_SIG_T
+typedef void (*sig_t)(int);
+#endif
+
 enum RorW
   {
     READ,

Modified: trunk/uim/uim-ipc.c
===================================================================
--- trunk/uim/uim-ipc.c	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/uim/uim-ipc.c	2005-02-13 02:10:24 UTC (rev 636)
@@ -47,7 +47,8 @@
 #include "uim-helper.h"
 
 #ifndef HAVE_STRSEP
-char *strsep(char **stringp, const char *delim);
+char *uim_strsep(char **stringp, const char *delim);
+#define strsep	uim_strsep
 #endif
 
 /* This function is come from the GNU C Library manual */

Modified: trunk/xim/locale.cpp
===================================================================
--- trunk/xim/locale.cpp	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/xim/locale.cpp	2005-02-13 02:10:24 UTC (rev 636)
@@ -287,6 +287,9 @@
     char *tmp, *tmpp;
     int len = 0;
 
+    if (locales == NULL)
+	return NULL;
+
     tmp = tmpp = strdup(locales);
     char *orig_locale = strdup(setlocale(LC_CTYPE, NULL));
 

Modified: trunk/xim/util.cpp
===================================================================
--- trunk/xim/util.cpp	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/xim/util.cpp	2005-02-13 02:10:24 UTC (rev 636)
@@ -85,9 +85,10 @@
 int vasprintf(char **ret, const char *fmt, va_list ap)
 {
     int len;
+    char c;
 
-    len = vsnprintf(NULL, 0, fmt, ap);
-    if (len <= 0)
+    len = vsnprintf(&c, 0, fmt, ap);
+    if (len < 0)
 	return len;
 
     (*ret) = (char *)malloc(len + 1);

Modified: trunk/xim/util.h
===================================================================
--- trunk/xim/util.h	2005-02-12 15:43:29 UTC (rev 635)
+++ trunk/xim/util.h	2005-02-13 02:10:24 UTC (rev 636)
@@ -56,6 +56,13 @@
 #endif
 
 #ifndef HAVE_STRSEP
-char *strsep(char **stringp, const char *delim);
+#ifdef ___cplusplus
+extern "C" {
 #endif
+char *uim_strsep(char **stringp, const char *delim);
+#define strsep	uim_strsep
+#ifdef __cplusplus
+}
 #endif
+#endif
+#endif



More information about the Uim-commit mailing list