Fixed byte order on Solaris and FreeBSD.

This commit is contained in:
Patrik Stridvall 2000-05-12 21:39:55 +00:00 committed by Alexandre Julliard
parent bedf40b58b
commit d303dad1fe
4 changed files with 16 additions and 28 deletions

View File

@ -17,7 +17,6 @@
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <endian.h>
#include "wrc.h"
#include "genres.h"
@ -76,7 +75,7 @@ void put_word(res_t *res, unsigned w)
grow_res(res, RES_BLOCKSIZE);
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -96,7 +95,7 @@ void put_dword(res_t *res, unsigned d)
grow_res(res, RES_BLOCKSIZE);
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -136,7 +135,7 @@ void set_word(res_t *res, int ofs, unsigned w)
{
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -153,7 +152,7 @@ void set_dword(res_t *res, int ofs, unsigned d)
{
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -185,7 +184,7 @@ WORD get_word(res_t *res, int ofs)
{
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -200,7 +199,7 @@ DWORD get_dword(res_t *res, int ofs)
{
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:

View File

@ -199,7 +199,7 @@ static int convert_bitmap(char *data, int size)
BITMAPINFOHEADER *bih = (BITMAPINFOHEADER *)data;
BITMAPV4HEADER *b4h = (BITMAPV4HEADER *)data;
int type = 0;
#if BYTE_ORDER == BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
DWORD bisizel = BYTESWAP_DWORD(sizeof(BITMAPINFOHEADER));
DWORD b4sizel = BYTESWAP_DWORD(sizeof(BITMAPV4HEADER));
DWORD bisizeb = sizeof(BITMAPINFOHEADER);
@ -262,7 +262,7 @@ static int convert_bitmap(char *data, int size)
switch(byteorder)
{
#if BYTE_ORDER == BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
default:
#endif
case WRC_BO_BIG:
@ -274,7 +274,7 @@ static int convert_bitmap(char *data, int size)
convert_bitmap_swap_v3(bih);
}
break;
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
default:
#endif
case WRC_BO_LITTLE:
@ -401,7 +401,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
/* The bitmap is in destination byteorder. We want native for our structures */
switch(byteorder)
{
#if BYTE_ORDER == BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
case WRC_BO_LITTLE:
#else
case WRC_BO_BIG:
@ -420,7 +420,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
/* The bitmap is in destination byteorder. We want native for our structures */
switch(byteorder)
{
#if BYTE_ORDER == BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
case WRC_BO_LITTLE:
#else
case WRC_BO_BIG:
@ -492,7 +492,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
/* The bitmap is in destination byteorder. We want native for our structures */
switch(byteorder)
{
#if BYTE_ORDER == BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
case WRC_BO_LITTLE:
#else
case WRC_BO_BIG:

View File

@ -105,7 +105,6 @@
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <endian.h>
#include "wrc.h"
#include "utils.h"
@ -2117,7 +2116,7 @@ static raw_data_t *int2raw_data(int i)
rd->data = (char *)xmalloc(rd->size);
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -2139,7 +2138,7 @@ static raw_data_t *long2raw_data(int i)
rd->data = (char *)xmalloc(rd->size);
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:
@ -2166,7 +2165,7 @@ static raw_data_t *str2raw_data(string_t *str)
int i;
switch(byteorder)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#ifndef WORDS_BIGENDIAN
case WRC_BO_BIG:
#else
case WRC_BO_LITTLE:

View File

@ -42,7 +42,6 @@
#include <assert.h>
#include <ctype.h>
#include <signal.h>
#include <endian.h>
#include "wrc.h"
#include "utils.h"
@ -54,15 +53,6 @@
#include "preproc.h"
#include "parser.h"
#ifndef BYTE_ORDER
# error BYTE_ORDER is not defined. Please report.
#endif
#if (!defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)) || (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN)
# error Neither BIG_ENDIAN nor LITTLE_ENDIAN system. This system is not supported. Please report.
#endif
static char usage[] =
"Usage: wrc [options...] [infile[.rc|.res]]\n"
" -a n Alignment of resource (win16 only, default is 4)\n"
@ -70,7 +60,7 @@ static char usage[] =
" -b Create an assembly array from a binary .res file\n"
" -B x Set output byte-order x={n[ative], l[ittle], b[ig]}\n"
" (win32 only; default is n[ative] which equals "
#if BYTE_ORDER == BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
"big"
#else
"little"