aboutsummaryrefslogtreecommitdiff
path: root/include/u.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-06 23:06:03 +0000
committerrsc <devnull@localhost>2005-01-06 23:06:03 +0000
commit9b4de09d413c43059afcd75ceba4d2adcdc0a0a8 (patch)
treec2f3b30410455ef5bec4654192a9336fc43cb9d6 /include/u.h
parentf8104b3d3df082856fe6f94af3c0665b81f86127 (diff)
downloadplan9port-9b4de09d413c43059afcd75ceba4d2adcdc0a0a8.tar.gz
plan9port-9b4de09d413c43059afcd75ceba4d2adcdc0a0a8.tar.bz2
plan9port-9b4de09d413c43059afcd75ceba4d2adcdc0a0a8.zip
fix autolib for gcc3+
Diffstat (limited to 'include/u.h')
-rw-r--r--include/u.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/u.h b/include/u.h
index d062a9db..b7319ae5 100644
--- a/include/u.h
+++ b/include/u.h
@@ -116,6 +116,16 @@ typedef short s16int;
*/
#define AUTOLIB(x) static int __p9l_autolib_ ## x = 1;
+/*
+ * Gcc 3 is too smart for its own good.
+ */
+#if defined(__GNUC__)
+# if __GNUC__ >= 3
+# undef AUTOLIB
+# define AUTOLIB(x) int __p9l_autolib_ ## x __attribute__ ((weak));
+# endif
+#endif
+
#if defined(__cplusplus)
}
#endif