diff -ur windres.orig/binutils/resbin.c windres.new/binutils/resbin.c --- binutils/resbin.c 2006-03-28 17:24:28.000000000 -0600 +++ binutils/resbin.c 2007-07-12 00:45:09.000000000 -0500 @@ -40,39 +40,39 @@ static void toosmall (const char *); static unichar *get_unicode - (const unsigned char *, unsigned long, int, int *); + (const unsigned char *, UINT32, int, int *); static int get_resid - (struct res_id *, const unsigned char *, unsigned long, int); + (struct res_id *, const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_generic - (enum res_type, const unsigned char *, unsigned long); + (enum res_type, const unsigned char *, UINT32); static struct res_resource *bin_to_res_cursor - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_menu - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct menuitem *bin_to_res_menuitems - (const unsigned char *, unsigned long, int, int *); + (const unsigned char *, UINT32, int, int *); static struct menuitem *bin_to_res_menuexitems - (const unsigned char *, unsigned long, int, int *); + (const unsigned char *, UINT32, int, int *); static struct res_resource *bin_to_res_dialog - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_string - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_fontdir - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_accelerators - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_rcdata - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_group_cursor - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_group_icon - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_version - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static struct res_resource *bin_to_res_userdata - (const unsigned char *, unsigned long, int); + (const unsigned char *, UINT32, int); static void get_version_header - (const unsigned char *, unsigned long, int, const char *, + (const unsigned char *, UINT32, int, const char *, unichar **, int *, int *, int *, int *); /* Given a resource type ID, a pointer to data, a length, return a @@ -82,7 +82,7 @@ struct res_resource * bin_to_res (struct res_id type, const unsigned char *data, - unsigned long length, int big_endian) + UINT32 length, int big_endian) { if (type.named) return bin_to_res_userdata (data, length, big_endian); @@ -135,7 +135,7 @@ /* Swap in a NULL terminated unicode string. */ static unichar * -get_unicode (const unsigned char *data, unsigned long length, +get_unicode (const unsigned char *data, UINT32 length, int big_endian, int *retlen) { int c, i; @@ -144,7 +144,7 @@ c = 0; while (1) { - if (length < (unsigned long) c * 2 + 2) + if (length < (UINT32) c * 2 + 2) toosmall (_("null terminated unicode string")); if (get_16 (big_endian, data + c * 2) == 0) break; @@ -167,7 +167,7 @@ static int get_resid (struct res_id *id, const unsigned char *data, - unsigned long length, int big_endian) + UINT32 length, int big_endian) { int first; @@ -196,7 +196,7 @@ struct res_resource * bin_to_res_generic (enum res_type type, const unsigned char *data, - unsigned long length) + UINT32 length) { struct res_resource *r; @@ -211,7 +211,7 @@ /* Convert a cursor resource from binary. */ struct res_resource * -bin_to_res_cursor (const unsigned char *data, unsigned long length, +bin_to_res_cursor (const unsigned char *data, UINT32 length, int big_endian) { struct cursor *c; @@ -236,7 +236,7 @@ /* Convert a menu resource from binary. */ struct res_resource * -bin_to_res_menu (const unsigned char *data, unsigned long length, +bin_to_res_menu (const unsigned char *data, UINT32 length, int big_endian) { struct res_resource *r; @@ -286,7 +286,7 @@ /* Convert menu items from binary. */ static struct menuitem * -bin_to_res_menuitems (const unsigned char *data, unsigned long length, +bin_to_res_menuitems (const unsigned char *data, UINT32 length, int big_endian, int *read) { struct menuitem *first, **pp; @@ -364,7 +364,7 @@ /* Convert menuex items from binary. */ static struct menuitem * -bin_to_res_menuexitems (const unsigned char *data, unsigned long length, +bin_to_res_menuexitems (const unsigned char *data, UINT32 length, int big_endian, int *read) { struct menuitem *first, **pp; @@ -439,7 +439,7 @@ /* Convert a dialog resource from binary. */ static struct res_resource * -bin_to_res_dialog (const unsigned char *data, unsigned long length, +bin_to_res_dialog (const unsigned char *data, UINT32 length, int big_endian) { int signature; @@ -625,7 +625,7 @@ /* Convert a stringtable resource from binary. */ static struct res_resource * -bin_to_res_string (const unsigned char *data, unsigned long length, +bin_to_res_string (const unsigned char *data, UINT32 length, int big_endian) { struct stringtable *st; @@ -672,7 +672,7 @@ /* Convert a fontdir resource from binary. */ static struct res_resource * -bin_to_res_fontdir (const unsigned char *data, unsigned long length, +bin_to_res_fontdir (const unsigned char *data, UINT32 length, int big_endian) { int c, i; @@ -742,7 +742,7 @@ /* Convert an accelerators resource from binary. */ static struct res_resource * -bin_to_res_accelerators (const unsigned char *data, unsigned long length, +bin_to_res_accelerators (const unsigned char *data, UINT32 length, int big_endian) { struct accelerator *first, **pp; @@ -785,7 +785,7 @@ /* Convert an rcdata resource from binary. */ static struct res_resource * -bin_to_res_rcdata (const unsigned char *data, unsigned long length, +bin_to_res_rcdata (const unsigned char *data, UINT32 length, int big_endian ATTRIBUTE_UNUSED) { struct rcdata_item *ri; @@ -808,7 +808,7 @@ /* Convert a group cursor resource from binary. */ static struct res_resource * -bin_to_res_group_cursor (const unsigned char *data, unsigned long length, +bin_to_res_group_cursor (const unsigned char *data, UINT32 length, int big_endian) { int type, c, i; @@ -864,7 +864,7 @@ /* Convert a group icon resource from binary. */ static struct res_resource * -bin_to_res_group_icon (const unsigned char *data, unsigned long length, +bin_to_res_group_icon (const unsigned char *data, UINT32 length, int big_endian) { int type, c, i; @@ -924,7 +924,7 @@ to the type, and *OFF to the offset to the children. */ static void -get_version_header (const unsigned char *data, unsigned long length, +get_version_header (const unsigned char *data, UINT32 length, int big_endian, const char *key, unichar **pkey, int *len, int *vallen, int *type, int *off) { @@ -973,7 +973,7 @@ /* Convert a version resource from binary. */ static struct res_resource * -bin_to_res_version (const unsigned char *data, unsigned long length, +bin_to_res_version (const unsigned char *data, UINT32 length, int big_endian) { int verlen, vallen, type, off; @@ -999,7 +999,7 @@ fi = NULL; else { - unsigned long signature, fiv; + UINT32 signature, fiv; if (vallen != 52) fatal (_("unexpected fixed version information length %d"), vallen); @@ -1192,7 +1192,7 @@ /* Convert an arbitrary user defined resource from binary. */ static struct res_resource * -bin_to_res_userdata (const unsigned char *data, unsigned long length, +bin_to_res_userdata (const unsigned char *data, UINT32 length, int big_endian ATTRIBUTE_UNUSED) { struct rcdata_item *ri; @@ -1220,7 +1220,7 @@ /* Local functions used to convert resources to binary format. */ -static void dword_align_bin (struct bindata ***, unsigned long *); +static void dword_align_bin (struct bindata ***, UINT32 *); static struct bindata *resid_to_bin (struct res_id, int); static struct bindata *unicode_to_bin (const unichar *, int); static struct bindata *res_to_bin_accelerator @@ -1249,7 +1249,7 @@ static struct bindata *res_to_bin_versioninfo (const struct versioninfo *, int); static struct bindata *res_to_bin_generic - (unsigned long, const unsigned char *); + (UINT32, const unsigned char *); /* Convert a resource to binary. */ @@ -1296,7 +1296,7 @@ boundary. It updates *PPP and *LENGTH. */ static void -dword_align_bin (struct bindata ***ppp, unsigned long *length) +dword_align_bin (struct bindata ***ppp, UINT32 *length) { int add; struct bindata *d; @@ -1502,7 +1502,7 @@ { int dialogex; struct bindata *first, **pp; - unsigned long length; + UINT32 length; int off, c; struct dialog_control *dc; @@ -1654,7 +1654,7 @@ put_16 (big_endian, 0, d->data); else { - unsigned long sublen; + UINT32 sublen; dword_align_bin (&pp, &length); @@ -1858,7 +1858,7 @@ res_to_bin_menuexitems (const struct menuitem *items, int big_endian) { struct bindata *first, **pp; - unsigned long length; + UINT32 length; const struct menuitem *mi; first = NULL; @@ -1965,7 +1965,7 @@ case RCDATA_WSTRING: { - unsigned long i; + UINT32 i; d->length = ri->u.wstring.length * 2; d->data = (unsigned char *) reswr_alloc (d->length); @@ -2055,7 +2055,7 @@ res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian) { struct bindata *first, **pp; - unsigned long length; + UINT32 length; struct ver_info *vi; first = (struct bindata *) reswr_alloc (sizeof *first); @@ -2114,7 +2114,7 @@ for (vi = versioninfo->var; vi != NULL; vi = vi->next) { struct bindata *vid; - unsigned long vilen; + UINT32 vilen; dword_align_bin (&pp, &length); @@ -2138,7 +2138,7 @@ case VERINFO_STRING: { - unsigned long hold, vslen; + UINT32 hold, vslen; struct bindata *vsd; const struct ver_stringinfo *vs; @@ -2174,7 +2174,7 @@ for (vs = vi->u.string.strings; vs != NULL; vs = vs->next) { struct bindata *vssd; - unsigned long vsslen; + UINT32 vsslen; hold = length; dword_align_bin (&pp, &length); @@ -2226,7 +2226,7 @@ case VERINFO_VAR: { - unsigned long hold, vvlen, vvvlen; + UINT32 hold, vvlen, vvvlen; struct bindata *vvd; const struct ver_varinfo *vv; @@ -2304,7 +2304,7 @@ /* Convert a generic resource to binary. */ static struct bindata * -res_to_bin_generic (unsigned long length, const unsigned char *data) +res_to_bin_generic (UINT32 length, const unsigned char *data) { struct bindata *d; diff -ur windres.orig/binutils/resrc.c windres.new/binutils/resrc.c --- binutils/resrc.c 2005-05-08 08:17:39.000000000 -0500 +++ binutils/resrc.c 2007-07-11 23:50:00.000000000 -0500 @@ -110,9 +110,9 @@ } cursor; } u; /* Bytes in image. */ - unsigned long bytes; + UINT32 bytes; /* File offset of image. */ - unsigned long offset; + UINT32 offset; }; /* The name of the rc file we are reading. */ @@ -169,8 +169,8 @@ static void close_input_stream (void); static void unexpected_eof (const char *); static int get_word (FILE *, const char *); -static unsigned long get_long (FILE *, const char *); -static void get_data (FILE *, unsigned char *, unsigned long, const char *); +static UINT32 get_long (FILE *, const char *); +static void get_data (FILE *, unsigned char *, UINT32, const char *); static void define_fontdirs (void); /* Run `cmd' and redirect the output to `redir'. */ @@ -555,7 +555,7 @@ /* Read a 32 bit word from a file. The data is assumed to be little endian. */ -static unsigned long +static UINT32 get_long (FILE *e, const char *msg) { int b1, b2, b3, b4; @@ -575,9 +575,9 @@ /* Read data from a file. This is a wrapper to do error checking. */ static void -get_data (FILE *e, unsigned char *p, unsigned long c, const char *msg) +get_data (FILE *e, unsigned char *p, UINT32 c, const char *msg) { - unsigned long got; + UINT32 got; got = fread (p, 1, c, e); if (got == c) @@ -788,10 +788,10 @@ merely allocates and fills in a structure. */ struct dialog_control * -define_control (const struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long width, unsigned long height, - unsigned long class, unsigned long style, - unsigned long exstyle) +define_control (const struct res_id iid, UINT32 id, UINT32 x, + UINT32 y, UINT32 width, UINT32 height, + UINT32 class, UINT32 style, + UINT32 exstyle) { struct dialog_control *n; @@ -814,9 +814,9 @@ } struct dialog_control * -define_icon_control (struct res_id iid, unsigned long id, unsigned long x, - unsigned long y, unsigned long style, - unsigned long exstyle, unsigned long help, +define_icon_control (struct res_id iid, UINT32 id, UINT32 x, + UINT32 y, UINT32 style, + UINT32 exstyle, UINT32 help, struct rcdata_item *data, struct dialog_ex *ex) { struct dialog_control *n; @@ -848,8 +848,8 @@ struct stat s; unsigned char *data; struct res_resource *r; - long offset; - long fontdatalength; + INT32 offset; + INT32 fontdatalength; unsigned char *fontdata; struct fontdir *fd; const char *device, *face; @@ -1095,8 +1095,8 @@ allocates and fills in a structure. */ struct menuitem * -define_menuitem (const char *text, int menuid, unsigned long type, - unsigned long state, unsigned long help, +define_menuitem (const char *text, int menuid, UINT32 type, + UINT32 state, UINT32 help, struct menuitem *menuitems) { struct menuitem *mi; @@ -1168,7 +1168,7 @@ /* Create an rcdata item holding a string. */ struct rcdata_item * -define_rcdata_string (const char *string, unsigned long len) +define_rcdata_string (const char *string, UINT32 len) { struct rcdata_item *ri; char *s; @@ -1187,7 +1187,7 @@ /* Create an rcdata item holding a number. */ struct rcdata_item * -define_rcdata_number (unsigned long val, int dword) +define_rcdata_number (UINT32 val, int dword) { struct rcdata_item *ri; @@ -1204,7 +1204,7 @@ void define_stringtable (const struct res_res_info *resinfo, - unsigned long stringid, const char *string) + UINT32 stringid, const char *string) { struct res_id id; struct res_resource *r; @@ -1414,8 +1414,8 @@ /* Append version variable information to a list. */ struct ver_varinfo * -append_vertrans (struct ver_varinfo *var, unsigned long language, - unsigned long charset) +append_vertrans (struct ver_varinfo *var, UINT32 language, + UINT32 charset) { struct ver_varinfo *vv, **pp; @@ -1456,7 +1456,7 @@ static void write_rc_stringtable (FILE *, const struct res_id *, const struct stringtable *); static void write_rc_versioninfo (FILE *, const struct versioninfo *); -static void write_rc_filedata (FILE *, unsigned long, const unsigned char *); +static void write_rc_filedata (FILE *, UINT32, const unsigned char *); /* Indent a given number of spaces. */ @@ -1543,7 +1543,7 @@ /* If we're at level 3, then this key represents a language. Use it to update the current language. */ if (! re->id.named - && re->id.u.id != (unsigned long) (unsigned int) *language + && re->id.u.id != (UINT32) (unsigned int) *language && (re->id.u.id & 0xffff) == re->id.u.id) { fprintf (e, "LANGUAGE %lu, %lu\n", @@ -1766,7 +1766,7 @@ if (rt != 0 && type != NULL - && (type->named || type->u.id != (unsigned long) rt)) + && (type->named || type->u.id != (UINT32) rt)) { fprintf (e, "// Unexpected resource type mismatch: "); res_id_print (e, *type, 1); @@ -2050,7 +2050,7 @@ { const char *name; unsigned short class; - unsigned long style; + UINT32 style; }; static const struct control_info control_info[] = @@ -2059,23 +2059,23 @@ { "AUTOCHECKBOX", CTL_BUTTON, BS_AUTOCHECKBOX }, { "AUTORADIOBUTTON", CTL_BUTTON, BS_AUTORADIOBUTTON }, { "CHECKBOX", CTL_BUTTON, BS_CHECKBOX }, - { "COMBOBOX", CTL_COMBOBOX, (unsigned long) -1 }, + { "COMBOBOX", CTL_COMBOBOX, (UINT32) -1 }, { "CTEXT", CTL_STATIC, SS_CENTER }, { "DEFPUSHBUTTON", CTL_BUTTON, BS_DEFPUSHBUTTON }, - { "EDITTEXT", CTL_EDIT, (unsigned long) -1 }, + { "EDITTEXT", CTL_EDIT, (UINT32) -1 }, { "GROUPBOX", CTL_BUTTON, BS_GROUPBOX }, { "ICON", CTL_STATIC, SS_ICON }, - { "LISTBOX", CTL_LISTBOX, (unsigned long) -1 }, + { "LISTBOX", CTL_LISTBOX, (UINT32) -1 }, { "LTEXT", CTL_STATIC, SS_LEFT }, { "PUSHBOX", CTL_BUTTON, BS_PUSHBOX }, { "PUSHBUTTON", CTL_BUTTON, BS_PUSHBUTTON }, { "RADIOBUTTON", CTL_BUTTON, BS_RADIOBUTTON }, { "RTEXT", CTL_STATIC, SS_RIGHT }, - { "SCROLLBAR", CTL_SCROLLBAR, (unsigned long) -1 }, + { "SCROLLBAR", CTL_SCROLLBAR, (UINT32) -1 }, { "STATE3", CTL_BUTTON, BS_3STATE }, /* It's important that USERBUTTON come after all the other button types, so that it won't be matched too early. */ - { "USERBUTTON", CTL_BUTTON, (unsigned long) -1 }, + { "USERBUTTON", CTL_BUTTON, (UINT32) -1 }, { NULL, 0, 0 } }; @@ -2094,7 +2094,7 @@ { for (ci = control_info; ci->name != NULL; ++ci) if (ci->class == control->class.u.id - && (ci->style == (unsigned long) -1 + && (ci->style == (UINT32) -1 || ci->style == (control->style & 0xff))) break; } @@ -2310,7 +2310,7 @@ case RCDATA_STRING: { const char *s; - unsigned long i; + UINT32 i; fprintf (e, "\""); s = ri->u.string.s; @@ -2333,7 +2333,7 @@ case RCDATA_BUFFER: { - unsigned long i; + UINT32 i; int first; /* Assume little endian data. */ @@ -2341,7 +2341,7 @@ first = 1; for (i = 0; i + 3 < ri->u.buffer.length; i += 4) { - unsigned long l; + UINT32 l; int j; if (! first) @@ -2448,7 +2448,7 @@ write_rc_stringtable (FILE *e, const struct res_id *name, const struct stringtable *stringtable) { - unsigned long offset; + UINT32 offset; int i; if (name != NULL && ! name->named) @@ -2568,9 +2568,9 @@ /* Write out data which would normally be read from a file. */ static void -write_rc_filedata (FILE *e, unsigned long length, const unsigned char *data) +write_rc_filedata (FILE *e, UINT32 length, const unsigned char *data) { - unsigned long i; + UINT32 i; for (i = 0; i + 15 < length; i += 16) { diff -ur windres.orig/binutils/resres.c windres.new/binutils/resres.c --- binutils/resres.c 2005-06-16 03:18:19.000000000 -0500 +++ binutils/resres.c 2007-07-11 23:51:23.000000000 -0500 @@ -33,8 +33,8 @@ struct res_hdr { - unsigned long data_size; - unsigned long header_size; + UINT32 data_size; + UINT32 header_size; }; static void write_res_directory @@ -52,7 +52,7 @@ static void write_res_info PARAMS ((const struct res_res_info *)); static void write_res_data PARAMS ((const void *, size_t, int)); static void write_res_header - PARAMS ((unsigned long, const struct res_id *, const struct res_id *, + PARAMS ((UINT32, const struct res_id *, const struct res_id *, const struct res_res_info *)); static int read_resource_entry PARAMS ((void)); @@ -61,7 +61,7 @@ static unichar *read_unistring PARAMS ((int *)); static void skip_null_resource PARAMS ((void)); -static unsigned long get_id_size PARAMS ((const struct res_id *)); +static UINT32 get_id_size PARAMS ((const struct res_id *)); static void res_align_file PARAMS ((void)); static void @@ -113,7 +113,7 @@ 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - long fpos; + INT32 fpos; filename = fn; @@ -146,7 +146,7 @@ struct res_id name; struct res_res_info resinfo; struct res_hdr reshdr; - long version; + INT32 version; void *buff; struct res_resource *r; @@ -219,7 +219,7 @@ /* If we're at level 3, then this key represents a language. Use it to update the current language. */ if (!re->id.named - && re->id.u.id != (unsigned long) *language + && re->id.u.id != (UINT32) *language && (re->id.u.id & 0xffff) == re->id.u.id) { *language = re->id.u.id; @@ -331,7 +331,7 @@ if (rt != 0 && type != NULL - && (type->named || type->u.id != (unsigned long) rt)) + && (type->named || type->u.id != (UINT32) rt)) { fprintf (stderr, "// Unexpected resource type mismatch: "); res_id_print (stderr, *type, 1); @@ -351,7 +351,7 @@ const struct res_id *name; const struct res_res_info *resinfo; { - unsigned long datasize = 0; + UINT32 datasize = 0; const struct bindata *bin_rep, *data; bin_rep = res_to_bin (res, 0); @@ -365,7 +365,7 @@ } /* Get number of bytes needed to store an id in binary format */ -static unsigned long +static UINT32 get_id_size (id) const struct res_id *id; { @@ -378,7 +378,7 @@ /* Write a resource header */ static void write_res_header (datasize, type, name, resinfo) - unsigned long datasize; + UINT32 datasize; const struct res_id *type; const struct res_id *name; const struct res_res_info *resinfo; @@ -430,7 +430,7 @@ { if (id->named) { - unsigned long len = id->u.n.length; + UINT32 len = id->u.n.length; unichar null_term = 0; write_res_data (id->u.n.name, len * sizeof (unichar), 1); write_res_data (&null_term, sizeof (null_term), 1); @@ -586,7 +586,7 @@ if (*resources == NULL) { - static unsigned long timeval; + static UINT32 timeval; /* Use the same timestamp for every resource created in a single run. */ diff -ur windres.orig/binutils/windres.c windres.new/binutils/windres.c --- binutils/windres.c 2005-10-03 13:37:44.000000000 -0500 +++ binutils/windres.c 2007-07-11 21:58:03.000000000 -0500 @@ -320,7 +320,7 @@ if (*resources == NULL) { - static unsigned long timeval; + static UINT32 timeval; /* Use the same timestamp for every resource created in a single run. */ diff -ur windres.orig/binutils/windres.h windres.new/binutils/windres.h --- binutils/windres.h 2005-05-08 08:17:39.000000000 -0500 +++ binutils/windres.h 2007-07-12 01:13:54.278037008 -0500 @@ -27,6 +27,9 @@ #include "winduni.h" +#define UINT32 unsigned int +#define INT32 int + /* We represent resources internally as a tree, similar to the tree used in the .rsrc section of a COFF file. The root is a res_directory structure. */ @@ -35,9 +38,9 @@ { /* Resource flags. According to the MS docs, this is currently always zero. */ - unsigned long characteristics; + UINT32 characteristics; /* Time/date stamp. */ - unsigned long time; + UINT32 time; /* Major version number. */ unsigned short major; /* Minor version number. */ @@ -63,7 +66,7 @@ unichar *name; } n; /* If the named field is zero, this is the ID. */ - unsigned long id; + UINT32 id; } u; }; @@ -127,11 +130,11 @@ COFF file, the res_directory structure has a characteristics field, but I don't know if it's related to the one in the res file. */ - unsigned long characteristics; + UINT32 characteristics; /* Version of the resource. Entirely user defined. In a COFF file, the res_directory structure has a characteristics field, but I don't know if it's related to the one in the res file. */ - unsigned long version; + UINT32 version; /* Memory flags. This is a combination of the MEMFLAG values defined below. Most of these values are historical, and are not meaningful for win32. I don't think there is any way to store @@ -146,11 +149,11 @@ { /* The code page used for the data. I don't really know what this should be. */ - unsigned long codepage; + UINT32 codepage; /* A resource entry in a COFF file has a reserved field, which we record here when reading a COFF file. When writing a COFF file, we set this field to zero. */ - unsigned long reserved; + UINT32 reserved; }; /* Resource data is stored in a res_resource structure. */ @@ -164,7 +167,7 @@ { struct { - unsigned long length; + UINT32 length; const unsigned char *data; } data; struct accelerator *acc; @@ -250,7 +253,7 @@ /* Y coordinate of hotspot. */ short yhotspot; /* Length of bitmap data. */ - unsigned long length; + UINT32 length; /* Data. */ const unsigned char *data; }; @@ -270,7 +273,7 @@ /* Bits per pixel. */ unsigned short bits; /* Number of bytes in cursor resource. */ - unsigned long bytes; + UINT32 bytes; /* Index of cursor resource. */ unsigned short index; }; @@ -280,9 +283,9 @@ struct dialog { /* Basic window style. */ - unsigned long style; + UINT32 style; /* Extended window style. */ - unsigned long exstyle; + UINT32 exstyle; /* X coordinate. */ unsigned short x; /* Y coordinate. */ @@ -312,7 +315,7 @@ struct dialog_ex { /* Help ID. */ - unsigned long help; + UINT32 help; /* Font weight. */ unsigned short weight; /* Whether the font is italic. */ @@ -482,9 +485,9 @@ /* ID. */ unsigned short id; /* Style. */ - unsigned long style; + UINT32 style; /* Extended style. */ - unsigned long exstyle; + UINT32 exstyle; /* X coordinate. */ unsigned short x; /* Y coordinate. */ @@ -500,7 +503,7 @@ /* Extra data for the window procedure. */ struct rcdata_item *data; /* Help ID. Only used in an extended dialog. */ - unsigned long help; + UINT32 help; }; /* Control classes. These can be used as the ID field in a struct @@ -521,7 +524,7 @@ /* Index of font entry. */ short index; /* Length of font information. */ - unsigned long length; + UINT32 length; /* Font information. */ const unsigned char *data; }; @@ -543,7 +546,7 @@ /* Bits per pixel. */ unsigned short bits; /* Number of bytes in cursor resource. */ - unsigned long bytes; + UINT32 bytes; /* Index of cursor resource. */ unsigned short index; }; @@ -556,7 +559,7 @@ struct menuitem *items; /* Help ID. I don't think there is any way to set this in an rc file, but it can appear in the binary format. */ - unsigned long help; + UINT32 help; }; /* A menu resource is a list of menuitem structures. */ @@ -567,9 +570,9 @@ struct menuitem *next; /* Type. In a normal menu, rather than a menuex, this is the flags field. */ - unsigned long type; + UINT32 type; /* State. This is only used in a menuex. */ - unsigned long state; + UINT32 state; /* Id. */ unsigned short id; /* Unicode text. */ @@ -577,7 +580,7 @@ /* Popup menu items for a popup. */ struct menuitem *popup; /* Help ID. This is only used in a menuex. */ - unsigned long help; + UINT32 help; }; /* Menu item flags. These can appear in the flags field of a struct @@ -613,20 +616,20 @@ union { unsigned int word; - unsigned long dword; + UINT32 dword; struct { - unsigned long length; + UINT32 length; const char *s; } string; struct { - unsigned long length; + UINT32 length; const unichar *w; } wstring; struct { - unsigned long length; + UINT32 length; const unsigned char *data; } buffer; } u; @@ -661,24 +664,24 @@ struct fixed_versioninfo { /* The file version, which is two 32 bit integers. */ - unsigned long file_version_ms; - unsigned long file_version_ls; + UINT32 file_version_ms; + UINT32 file_version_ls; /* The product version, which is two 32 bit integers. */ - unsigned long product_version_ms; - unsigned long product_version_ls; + UINT32 product_version_ms; + UINT32 product_version_ls; /* The file flags mask. */ - unsigned long file_flags_mask; + UINT32 file_flags_mask; /* The file flags. */ - unsigned long file_flags; + UINT32 file_flags; /* The OS type. */ - unsigned long file_os; + UINT32 file_os; /* The file type. */ - unsigned long file_type; + UINT32 file_type; /* The file subtype. */ - unsigned long file_subtype; + UINT32 file_subtype; /* The date, which in Windows is two 32 bit integers. */ - unsigned long file_date_ms; - unsigned long file_date_ls; + UINT32 file_date_ms; + UINT32 file_date_ls; }; /* A list of variable version information. */ @@ -742,7 +745,7 @@ /* Next data. */ struct bindata *next; /* Length of data. */ - unsigned long length; + UINT32 length; /* Data. */ unsigned char *data; }; @@ -761,7 +764,7 @@ (const char *, const char *, const struct res_directory *); extern struct res_resource *bin_to_res - (struct res_id, const unsigned char *, unsigned long, int); + (struct res_id, const unsigned char *, UINT32, int); extern struct bindata *res_to_bin (const struct res_resource *, int); extern FILE *open_file_search @@ -812,11 +815,11 @@ extern void define_dialog (struct res_id, const struct res_res_info *, const struct dialog *); extern struct dialog_control *define_control - (const struct res_id, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); + (const struct res_id, UINT32, UINT32, UINT32, + UINT32, UINT32, UINT32, UINT32, UINT32); extern struct dialog_control *define_icon_control - (struct res_id, unsigned long, unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, struct rcdata_item *, struct dialog_ex *); + (struct res_id, UINT32, UINT32, UINT32, UINT32, + UINT32, UINT32, struct rcdata_item *, struct dialog_ex *); extern void define_font (struct res_id, const struct res_res_info *, const char *); extern void define_icon @@ -824,7 +827,7 @@ extern void define_menu (struct res_id, const struct res_res_info *, struct menuitem *); extern struct menuitem *define_menuitem - (const char *, int, unsigned long, unsigned long, unsigned long, + (const char *, int, UINT32, UINT32, UINT32, struct menuitem *); extern void define_messagetable (struct res_id, const struct res_res_info *, const char *); @@ -833,10 +836,10 @@ extern void define_rcdata_file (struct res_id, const struct res_res_info *, const char *); extern struct rcdata_item *define_rcdata_string - (const char *, unsigned long); -extern struct rcdata_item *define_rcdata_number (unsigned long, int); + (const char *, UINT32); +extern struct rcdata_item *define_rcdata_number (UINT32, int); extern void define_stringtable - (const struct res_res_info *, unsigned long, const char *); + (const struct res_res_info *, UINT32, const char *); extern void define_user_data (struct res_id, struct res_id, const struct res_res_info *, struct rcdata_item *); @@ -851,4 +854,4 @@ extern struct ver_stringinfo *append_verval (struct ver_stringinfo *, const char *, const char *); extern struct ver_varinfo *append_vertrans - (struct ver_varinfo *, unsigned long, unsigned long); + (struct ver_varinfo *, UINT32, UINT32);