aboutsummaryrefslogtreecommitdiff
path: root/binutils/strings.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@tuliptree.org>2005-06-03 21:33:49 +0000
committerJim Wilson <wilson@tuliptree.org>2005-06-03 21:33:49 +0000
commitb7d4af3a128f09640f4d0982d7d9b9333eadccdf (patch)
tree240b195c88c6a57ec8b9ece6c42fcd624059cf19 /binutils/strings.c
parent82d457f64ba1cd414364a3907d9533664f5e034b (diff)
downloadgdb-b7d4af3a128f09640f4d0982d7d9b9333eadccdf.zip
gdb-b7d4af3a128f09640f4d0982d7d9b9333eadccdf.tar.gz
gdb-b7d4af3a128f09640f4d0982d7d9b9333eadccdf.tar.bz2
Patch from Steve Ellcey for hpux build failure.
* configure.in: Check for getc_unlocked prototype. * configure: Regenerate. * config.in: Regenerate. * strings.c (get_char): Only call getc_unlocked if we have seen a prototype.
Diffstat (limited to 'binutils/strings.c')
-rw-r--r--binutils/strings.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/binutils/strings.c b/binutils/strings.c
index e5519e1..fda63bd 100644
--- a/binutils/strings.c
+++ b/binutils/strings.c
@@ -447,7 +447,12 @@ get_char (FILE *stream, file_off *address, int *magiccount, char **magic)
{
if (stream == NULL)
return EOF;
-#ifdef HAVE_GETC_UNLOCKED
+
+ /* Only use getc_unlocked if we found a declaration for it.
+ Otherwise, libc is not thread safe by default, and we
+ should not use it. */
+
+#if defined(HAVE_GETC_UNLOCKED) && HAVE_DECL_GETC_UNLOCKED
c = getc_unlocked (stream);
#else
c = getc (stream);