This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] If f(un)lockfile is unavailable define it away


Sometimes _POSIX_THREAD_SAFE_FUNCTIONS is still set in this case, which
in turn leads to build problems in getopt.c (which would define the
functions to nop anyway if it knew they aren't present).

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
 lib/ChangeLog   | 5 +++++
 lib/eu-config.h | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/lib/ChangeLog b/lib/ChangeLog
index ecc6179..58ee43f 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-03  Ulf Hermann  <ulf.hermann@qt.io>
+
+	* eu-config.h: Define flockfile and funlockfile away if gnulib hasn't
+	detected them.
+
 2017-04-27  Ulf Hermann  <ulf.hermann@qt.io>
 
 	* eu-config.h: Define attribute_hidden to be empty if the compiler
diff --git a/lib/eu-config.h b/lib/eu-config.h
index 135803e..e69b213 100644
--- a/lib/eu-config.h
+++ b/lib/eu-config.h
@@ -198,5 +198,12 @@ asm (".section predict_data, \"aw\"; .previous\n"
 # define COMPAT_VERSION(name, version, prefix) error "should use #ifdef SYMBOL_VERSIONING"
 #endif
 
+#if !HAVE_FLOCKFILE
+# define flockfile(fp) /* nop */
+#endif
+
+#if !HAVE_FUNLOCKFILE
+# define funlockfile(fp) /* nop */
+#endif
 
 #endif	/* eu-config.h */
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]