public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Ulf Hermann <ulf.hermann@qt.io>
To: <elfutils-devel@sourceware.org>
Subject: [PATCH] If f(un)lockfile is unavailable define it away
Date: Thu, 04 May 2017 08:16:00 -0000	[thread overview]
Message-ID: <1ca32ffc-b613-4481-5886-ad782865e497@qt.io> (raw)

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

                 reply	other threads:[~2017-05-03 16:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ca32ffc-b613-4481-5886-ad782865e497@qt.io \
    --to=ulf.hermann@qt.io \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).