/* windres.c -- a program to manipulate Windows resources
- Copyright (C) 1997-2015 Free Software Foundation, Inc.
+ Copyright (C) 1997-2020 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Rewritten by Kai Tietz, Onevision.
expandargv (&argc, &argv);
- bfd_init ();
+ if (bfd_init () != BFD_INIT_MAGIC)
+ fatal (_("fatal error: libbfd ABI mismatch"));
set_default_bfd_target ();
res_init ();
{
struct stat statbuf;
char modebuf[11];
-
+
if (stat (optarg, & statbuf) == 0
/* Coded this way to avoid importing knowledge of S_ISDIR into this file. */
&& (mode_string (statbuf.st_mode, modebuf), modebuf[0] == 'd'))
if (rdmode && ! bfd_check_format (abfd, bfd_object))
fatal ("can't open `%s' for input.", filename);
-
+
return abfd;
}
target_get_8 (const void *p, rc_uint_type length)
{
rc_uint_type ret;
-
+
if (length < 1)
fatal ("Resource too small for getting 8-bit value.");
{
if (length < 2)
fatal ("Resource too small for getting 16-bit value.");
-
+
if (target_is_bigendian)
return bfd_getb16 (p);
else
{
if (length < 4)
fatal ("Resource too small for getting 32-bit value.");
-
+
if (target_is_bigendian)
return bfd_getb32 (p);
else
target_put_16 (void *p, rc_uint_type value)
{
assert (!! p);
-
+
if (target_is_bigendian)
bfd_putb16 (value, p);
else
target_put_32 (void *p, rc_uint_type value)
{
assert (!! p);
-
+
if (target_is_bigendian)
bfd_putb32 (value, p);
else
va_start (arg, fmt);
r += vfprintf (e, fmt, arg);
va_end (arg);
- return r;
+ return r;
}