Patch from Steve Ellcey for hpux build failure.
[deliverable/binutils-gdb.git] / binutils / strings.c
index e5519e1420917966e59c562cc46ae2be8e8840b7..fda63bdd004135ed0aa8cc54d56b6b43f57b77a7 100644 (file)
@@ -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);
This page took 0.023433 seconds and 4 git commands to generate.