[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lock: fix compilation error on HP-UX IA64
From: |
Bruno Haible |
Subject: |
lock: fix compilation error on HP-UX IA64 |
Date: |
Sun, 19 Mar 2017 20:43:13 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-66-generic; KDE/5.18.0; x86_64; ; ) |
On HP-UX IA64 with this new shining compiler, I'm seeing this compilation
error:
-------------------------------------------------------------------------------
cc +DD64 -AC99 -D_XOPEN_SOURCE=500 -DHAVE_CONFIG_H -I. -I../../src/gllib -I..
-g -c -o glthread/lock.o ../../src/gllib/glthread/lock.c
"../../src/gllib/glthread/lock.h", line 143: error #4270:
"pthread_rwlockattr_setkind_np" is undefined, pragma ignored
# pragma weak pthread_rwlockattr_setkind_np
^
1 error detected in the compilation of "../../src/gllib/glthread/lock.c".
-------------------------------------------------------------------------------
Although this error message is a candidate for a hall of fame, let me add a
workaround:
2017-03-19 Bruno Haible <address@hidden>
lock: Fix compilation error with HP-UX IA64 cc.
* lib/glthread/lock.h (pthread_rwlockattr_setkind_np): Don't declare
weak on non-glibc platforms.
diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h
index 67932aa..ec8d11d 100644
--- a/lib/glthread/lock.h
+++ b/lib/glthread/lock.h
@@ -140,7 +140,9 @@ extern int glthread_in_use (void);
# pragma weak pthread_mutexattr_settype
# pragma weak pthread_mutexattr_destroy
# pragma weak pthread_rwlockattr_init
-# pragma weak pthread_rwlockattr_setkind_np
+# if __GNU_LIBRARY__ > 1
+# pragma weak pthread_rwlockattr_setkind_np
+# endif
# pragma weak pthread_rwlockattr_destroy
# ifndef pthread_self
# pragma weak pthread_self
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lock: fix compilation error on HP-UX IA64,
Bruno Haible <=