/* resres.c: read_res_file and write_res_file implementation for windres.
- Copyright 1998, 1999, 2001, 2002, 2007
+ Copyright 1998, 1999, 2001, 2002, 2005, 2007, 2008
Free Software Foundation, Inc.
Written by Anders Norlander <anorland@hem2.passagen.se>.
Rewritten by Kai Tietz, Onevision.
filename = fn;
abfd = windres_open_as_binary (filename, 0);
- sec = bfd_make_section (abfd, ".data");
+ sec = bfd_make_section_with_flags (abfd, ".data",
+ (SEC_HAS_CONTENTS | SEC_ALLOC
+ | SEC_LOAD | SEC_DATA));
if (sec == NULL)
bfd_fatal ("bfd_make_section");
- if (! bfd_set_section_flags (abfd, sec,
- (SEC_HAS_CONTENTS | SEC_ALLOC
- | SEC_LOAD | SEC_DATA)))
- bfd_fatal ("bfd_set_section_flags");
/* Requiring this is probably a bug in BFD. */
sec->output_section = sec;
(const rc_res_id *) NULL,
&language, 1);
if (sec_length != sec_length_wrote)
- fatal ("res write failed with different sizes (%lu/%lu).", (long) sec_length,
- (long) sec_length_wrote);
+ fatal ("res write failed with different sizes (%lu/%lu).",
+ (unsigned long) sec_length, (unsigned long) sec_length_wrote);
bfd_close (abfd);
return;
and modified to add an existing resource.
*/
static void
-res_append_resource (rc_res_directory **resources, rc_res_resource *resource,
+res_append_resource (rc_res_directory **res_dirs, rc_res_resource *resource,
int cids, const rc_res_id *ids, int dupok)
{
rc_res_entry *re = NULL;
{
rc_res_entry **pp;
- if (*resources == NULL)
+ if (*res_dirs == NULL)
{
static unsigned long timeval;
if (timeval == 0)
timeval = time (NULL);
- *resources = ((rc_res_directory *)
+ *res_dirs = ((rc_res_directory *)
res_alloc (sizeof (rc_res_directory)));
- (*resources)->characteristics = 0;
- (*resources)->time = timeval;
- (*resources)->major = 0;
- (*resources)->minor = 0;
- (*resources)->entries = NULL;
+ (*res_dirs)->characteristics = 0;
+ (*res_dirs)->time = timeval;
+ (*res_dirs)->major = 0;
+ (*res_dirs)->minor = 0;
+ (*res_dirs)->entries = NULL;
}
- for (pp = &(*resources)->entries; *pp != NULL; pp = &(*pp)->next)
+ for (pp = &(*res_dirs)->entries; *pp != NULL; pp = &(*pp)->next)
if (res_id_cmp ((*pp)->id, ids[i]) == 0)
break;
xexit (1);
}
- resources = &re->u.dir;
+ res_dirs = &re->u.dir;
}
}