changeset 10262:7f487c725a90

[gaim-migrate @ 11406] the autopackage guys were nice enough to quicly fix this for me. basicly a function was getting #ifdef'd out if you compild with --disable-binreloc, that shouldn't have been. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Thu, 25 Nov 2004 20:48:16 +0000
parents d4e9ff2edc4e
children 1668fcab5968
files src/prefix.c src/prefix.h
diffstat 2 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/prefix.c	Thu Nov 25 18:35:26 2004 +0000
+++ b/src/prefix.c	Thu Nov 25 20:48:16 2004 +0000
@@ -286,12 +286,14 @@
  * Store str in a thread-local variable and return str. The next
  * you run this function, that variable is freed too.
  * This function is created so you don't have to worry about freeing
- * strings.
+ * strings. Just be careful about doing this sort of thing:
+ *
+ * some_function( BR_DATADIR("/one.png"), BR_DATADIR("/two.png") )
  *
- * Example:
+ * Examples:
  * char *foo;
- * foo = thread_local_store (strdup ("hello")); --> foo == "hello"
- * foo = thread_local_store (strdup ("world")); --> foo == "world"; "hello" is now freed.
+ * foo = br_thread_local_store (strdup ("hello")); --> foo == "hello"
+ * foo = br_thread_local_store (strdup ("world")); --> foo == "world"; "hello" is now freed.
  */
 const char *
 br_thread_local_store (char *str)
--- a/src/prefix.h	Thu Nov 25 18:35:26 2004 +0000
+++ b/src/prefix.h	Thu Nov 25 20:48:16 2004 +0000
@@ -88,13 +88,13 @@
 /* The following functions are used internally by BinReloc
    and shouldn't be used directly in applications. */
 
-const char *br_thread_local_store (char *str);
 char *br_locate		(void *symbol);
 char *br_locate_prefix	(void *symbol);
 char *br_prepend_prefix	(void *symbol, char *path);
 
+#endif /* ENABLE_BINRELOC */
 
-#endif /* ENABLE_BINRELOC */
+const char *br_thread_local_store (char *str);
 
 
 /* These macros and functions are not guarded by the ENABLE_BINRELOC
@@ -108,6 +108,14 @@
 
 #ifndef BR_NO_MACROS
 	/* Convenience functions for concatenating paths */
+
+	/* Each time you call one, the previous result will be freed. So don't do this:
+	 *
+	 *   some_function( BR_DATADIR("/one"), BR_DATADIR("/two") )
+	 *
+	 * as the first parameter will now be bogus!
+	 */
+
 	#define BR_SELFPATH(suffix)	(br_thread_local_store (br_strcat (SELFPATH, suffix)))
 	#define BR_PREFIX(suffix)	(br_thread_local_store (br_strcat (PREFIX, suffix)))
 	#define BR_PREFIXDIR(suffix)	(br_thread_local_store (br_strcat (BR_PREFIX, suffix)))