Bring back MAXPATHLEN (which was always guaranteed to be defined earlier

Wed, 20 Jun 2007 01:28:57 +0000

author
Stu Tomlinson <nosnilmot@pidgin.im>
date
Wed, 20 Jun 2007 01:28:57 +0000
changeset 18267
076446fd04a3
parent 18266
fc3b7817b6c1
child 18268
64f5e96df244
child 18271
98244567bc6f

Bring back MAXPATHLEN (which was always guaranteed to be defined earlier
anyway, zephyr was just missing the appropriate #include) and fix core.c
for building on glib < 2.4, and a small tweak to the compatibility #define
for G_GNUC_NULL_TERMINATED

libpurple/core.c file | annotate | diff | comparison | revisions
libpurple/internal.h file | annotate | diff | comparison | revisions
--- a/libpurple/core.c	Tue Jun 19 23:52:23 2007 +0000
+++ b/libpurple/core.c	Wed Jun 20 01:28:57 2007 +0000
@@ -512,7 +512,7 @@
 
 				if ((linklen = readlink(name, buf, sizeof(buf) - 1) == -1))
 				{
-					char *name_utf8 = g_filename_to_utf8(name);
+					char *name_utf8 = g_filename_to_utf8(name, -1, NULL, NULL, NULL);
 					purple_debug_error("core", "Error reading symlink %s: %s. Please report this at http://developer.pidgin.im\n",
 					                   name_utf8, strerror(errno));
 					g_free(name_utf8);
--- a/libpurple/internal.h	Tue Jun 19 23:52:23 2007 +0000
+++ b/libpurple/internal.h	Wed Jun 20 01:28:57 2007 +0000
@@ -111,6 +111,14 @@
 # include <unistd.h>
 #endif
 
+#ifndef MAXPATHLEN
+# ifdef PATH_MAX
+#  define MAXPATHLEN PATH_MAX
+# else
+#  define MAXPATHLEN 1024
+# endif
+#endif
+
 #ifndef HOST_NAME_MAX
 # define HOST_NAME_MAX 255
 #endif
@@ -171,7 +179,11 @@
 #endif
 
 #ifndef G_GNUC_NULL_TERMINATED
-#	define G_GNUC_NULL_TERMINATED
+#	if     __GNUC__ >= 4
+#		define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
+#	else
+#		define G_GNUC_NULL_TERMINATED
+#	endif
 #endif
 
 /* Safer ways to work with static buffers. When using non-static

mercurial