aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-05 15:27:37 +0930
committerAlan Modra <amodra@gmail.com>2021-04-05 15:27:37 +0930
commit83c79df86bf40666d1da7cd884bc10d45773df91 (patch)
tree1958fb387f15984aea41c900c959bb88c5dfb71a /bfd/peXXigen.c
parent5d4d26d14ca3dcf4c2d0745df720a2a5bd1bd6a5 (diff)
downloadgdb-83c79df86bf40666d1da7cd884bc10d45773df91.zip
gdb-83c79df86bf40666d1da7cd884bc10d45773df91.tar.gz
gdb-83c79df86bf40666d1da7cd884bc10d45773df91.tar.bz2
C99 bfd configury
Certain library headers and functions are required by C99. This removes configure tests for them. The patch also removes AC_ISC_POSIX and AC_HEADER_DIRENT, which the autoconf manual states are obsolescent. sys/time.h is no longer tangled up with time.h so it can be handled by the gprof configure. * configure.ac: Don't check for long long or long double type. Don't check for alloca.h, limits.h, stddef.h, stdlib.h, string.h, strings.h, time.h, wchar.h, wctype.h or sys/time.h. Don't check for strtoull, free, malloc, realloc, getenv, strstr, snprintf, vsnprintf, strlen or setitimer. Sort AC_CHECK_DECLS. (AC_ISC_POSIX): Don't invoke. (AC_HEADER_TIME, AC_HEADER_DIRENT, ACX_HEADER_STRING): Likewise. * sysdep.h: Remove many HAVE_*_H checks and fallback declarations. Do test HAVE_SYS_TYPES_H. Don't include sys/time.h. Reorder header order as per automake AC_INCLUDES_DEFAULT. * bfd-in.h: Include inttypes.h unconditionally. * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Assume long long and long double are available. (bfd_scan_vma): Assume long long and strtoull are available. * elflink.c: Include limits.h unconditionally. * elfnn-riscv.c: Likewise. * wasm-module.c: Likewise. * hpux-core.c: Include dirent.h unconditionally. * trad-core.c: Likewise. * hosts/x86-64linux.h: Include stdlib.h unconditionally. * peXXigen.c: Remove HAVE_WCHAR_H and HAVE_WCTYPE_H checks. * elf32-m68hc1x.c: Don't include alloca-conf.h. * elf64-hppa.c: Likewise. * som.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * bfd-in2.h: Regenerate. * config.in: Regenerate. * configure: Regenerate.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index e7f1311..b9a679a 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -70,12 +70,8 @@
#include "coff/internal.h"
#include "bfdver.h"
#include "libiberty.h"
-#ifdef HAVE_WCHAR_H
#include <wchar.h>
-#endif
-#ifdef HAVE_WCTYPE_H
#include <wctype.h>
-#endif
/* NOTE: it's strange to be including an architecture specific header
in what's supposed to be general (to PE/PEI) code. However, that's
@@ -3548,16 +3544,12 @@ rsrc_write_directory (rsrc_write_data * data,
BFD_ASSERT (nt == next_entry);
}
-#if defined HAVE_WCHAR_H && ! defined __CYGWIN__ && ! defined __MINGW32__
+#if ! defined __CYGWIN__ && ! defined __MINGW32__
/* Return the length (number of units) of the first character in S,
putting its 'ucs4_t' representation in *PUC. */
static unsigned int
-#if defined HAVE_WCTYPE_H
u16_mbtouc (wint_t * puc, const unsigned short * s, unsigned int n)
-#else
-u16_mbtouc (wchar_t * puc, const unsigned short * s, unsigned int n)
-#endif
{
unsigned short c = * s;
@@ -3589,7 +3581,7 @@ u16_mbtouc (wchar_t * puc, const unsigned short * s, unsigned int n)
*puc = 0xfffd;
return 1;
}
-#endif /* HAVE_WCHAR_H and not Cygwin/Mingw */
+#endif /* not Cygwin/Mingw */
/* Perform a comparison of two entries. */
static signed int
@@ -3626,20 +3618,15 @@ rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b)
res = rscpcmp ((const wchar_t *) astring, (const wchar_t *) bstring,
min (alen, blen));
-#elif defined HAVE_WCHAR_H
+#else
{
unsigned int i;
res = 0;
for (i = min (alen, blen); i--; astring += 2, bstring += 2)
{
-#if defined HAVE_WCTYPE_H
wint_t awc;
wint_t bwc;
-#else
- wchar_t awc;
- wchar_t bwc;
-#endif
/* Convert UTF-16 unicode characters into wchar_t characters
so that we can then perform a case insensitive comparison. */
@@ -3649,21 +3636,14 @@ rsrc_cmp (bool is_name, rsrc_entry * a, rsrc_entry * b)
if (Alen != Blen)
return Alen - Blen;
-#ifdef HAVE_WCTYPE_H
awc = towlower (awc);
bwc = towlower (bwc);
res = awc - bwc;
-#else
- res = wcsncasecmp (& awc, & bwc, 1);
-#endif
if (res)
break;
}
}
-#else
- /* Do the best we can - a case sensitive, untranslated comparison. */
- res = memcmp (astring, bstring, min (alen, blen) * 2);
#endif
if (res == 0)