cleanup endian handling
- define __BIG_ENDIAN__ or __LITTLE_ENDIAN__ with cmake & scons. - ENDIAN_ORDER is now a define rather than a global short. - replace checks like this with single ifdef: #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__) - remove BKE_endian.h which isn't used
This commit is contained in:
@@ -105,6 +105,7 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
|
|||||||
|
|
||||||
get_blender_version()
|
get_blender_version()
|
||||||
|
|
||||||
|
|
||||||
# Blender internal features
|
# Blender internal features
|
||||||
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
||||||
mark_as_advanced(WITH_BLENDER)
|
mark_as_advanced(WITH_BLENDER)
|
||||||
@@ -1150,6 +1151,18 @@ if(WITH_RAYOPTIMIZATION)
|
|||||||
unset(_sse2)
|
unset(_sse2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# set the endian define
|
||||||
|
include(TestBigEndian)
|
||||||
|
test_big_endian(_SYSTEM_BIG_ENDIAN)
|
||||||
|
if(_SYSTEM_BIG_ENDIAN)
|
||||||
|
add_definitions(-D__BIG_ENDIAN__)
|
||||||
|
else()
|
||||||
|
add_definitions(-D__LITTLE_ENDIAN__)
|
||||||
|
endif()
|
||||||
|
unset(_SYSTEM_BIG_ENDIAN)
|
||||||
|
|
||||||
|
|
||||||
if(WITH_IMAGE_OPENJPEG)
|
if(WITH_IMAGE_OPENJPEG)
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
# dealt with above
|
# dealt with above
|
||||||
|
|||||||
11
SConstruct
11
SConstruct
@@ -337,6 +337,17 @@ if env['BF_NO_ELBEEM'] == 1:
|
|||||||
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
|
||||||
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
|
||||||
|
|
||||||
|
|
||||||
|
if btools.ENDIAN == "big":
|
||||||
|
env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
|
||||||
|
env['CXXFLAGS'].append('-D__BIG_ENDIAN__')
|
||||||
|
env['CCFLAGS'].append('-D__BIG_ENDIAN__')
|
||||||
|
else:
|
||||||
|
env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||||
|
env['CXXFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||||
|
env['CCFLAGS'].append('-D__LITTLE_ENDIAN__')
|
||||||
|
|
||||||
|
|
||||||
# TODO, make optional
|
# TODO, make optional
|
||||||
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
|
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
|
||||||
env['CXXFLAGS'].append('-DWITH_AUDASPACE')
|
env['CXXFLAGS'].append('-DWITH_AUDASPACE')
|
||||||
|
|||||||
@@ -63,9 +63,27 @@ def get_revision():
|
|||||||
|
|
||||||
return 'r' + build_rev
|
return 'r' + build_rev
|
||||||
|
|
||||||
|
|
||||||
|
# copied from: http://www.scons.org/wiki/AutoconfRecipes
|
||||||
|
def checkEndian():
|
||||||
|
import struct
|
||||||
|
array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04')
|
||||||
|
i = struct.unpack('i', array)
|
||||||
|
# Little Endian
|
||||||
|
if i == struct.unpack('<i', array):
|
||||||
|
return "little"
|
||||||
|
# Big Endian
|
||||||
|
elif i == struct.unpack('>i', array):
|
||||||
|
return "big"
|
||||||
|
else:
|
||||||
|
raise Exception("cant find endian")
|
||||||
|
|
||||||
|
|
||||||
# This is used in creating the local config directories
|
# This is used in creating the local config directories
|
||||||
VERSION, VERSION_DISPLAY = get_version()
|
VERSION, VERSION_DISPLAY = get_version()
|
||||||
REVISION = get_revision()
|
REVISION = get_revision()
|
||||||
|
ENDIAN = checkEndian()
|
||||||
|
|
||||||
|
|
||||||
def print_arguments(args, bc):
|
def print_arguments(args, bc):
|
||||||
if len(args):
|
if len(args):
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_Reference<AUD_IReader> reader,
|
|||||||
AUD_EffectReader(reader),
|
AUD_EffectReader(reader),
|
||||||
m_format(specs.format)
|
m_format(specs.format)
|
||||||
{
|
{
|
||||||
int bigendian = 1;
|
|
||||||
bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
|
|
||||||
|
|
||||||
switch(m_format)
|
switch(m_format)
|
||||||
{
|
{
|
||||||
case AUD_FORMAT_U8:
|
case AUD_FORMAT_U8:
|
||||||
@@ -48,10 +45,11 @@ AUD_ConverterReader::AUD_ConverterReader(AUD_Reference<AUD_IReader> reader,
|
|||||||
m_convert = AUD_convert_float_s16;
|
m_convert = AUD_convert_float_s16;
|
||||||
break;
|
break;
|
||||||
case AUD_FORMAT_S24:
|
case AUD_FORMAT_S24:
|
||||||
if(bigendian)
|
#ifdef __BIG_ENDIAN__
|
||||||
m_convert = AUD_convert_float_s24_be;
|
m_convert = AUD_convert_float_s24_be;
|
||||||
else
|
#else
|
||||||
m_convert = AUD_convert_float_s24_le;
|
m_convert = AUD_convert_float_s24_le;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case AUD_FORMAT_S32:
|
case AUD_FORMAT_S32:
|
||||||
m_convert = AUD_convert_float_s32;
|
m_convert = AUD_convert_float_s32;
|
||||||
|
|||||||
@@ -37,9 +37,6 @@
|
|||||||
AUD_Mixer::AUD_Mixer(AUD_DeviceSpecs specs) :
|
AUD_Mixer::AUD_Mixer(AUD_DeviceSpecs specs) :
|
||||||
m_specs(specs)
|
m_specs(specs)
|
||||||
{
|
{
|
||||||
int bigendian = 1;
|
|
||||||
bigendian = (((char*)&bigendian)[0]) ? 0: 1; // 1 if Big Endian
|
|
||||||
|
|
||||||
switch(m_specs.format)
|
switch(m_specs.format)
|
||||||
{
|
{
|
||||||
case AUD_FORMAT_U8:
|
case AUD_FORMAT_U8:
|
||||||
@@ -49,10 +46,12 @@ AUD_Mixer::AUD_Mixer(AUD_DeviceSpecs specs) :
|
|||||||
m_convert = AUD_convert_float_s16;
|
m_convert = AUD_convert_float_s16;
|
||||||
break;
|
break;
|
||||||
case AUD_FORMAT_S24:
|
case AUD_FORMAT_S24:
|
||||||
if(bigendian)
|
|
||||||
m_convert = AUD_convert_float_s24_be;
|
#ifdef __BIG_ENDIAN__
|
||||||
else
|
m_convert = AUD_convert_float_s24_be;
|
||||||
m_convert = AUD_convert_float_s24_le;
|
#else
|
||||||
|
m_convert = AUD_convert_float_s24_le;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case AUD_FORMAT_S32:
|
case AUD_FORMAT_S32:
|
||||||
m_convert = AUD_convert_float_s32;
|
m_convert = AUD_convert_float_s32;
|
||||||
|
|||||||
@@ -124,10 +124,10 @@ static const char *check_memlist(MemHead *memh);
|
|||||||
/* locally used defines */
|
/* locally used defines */
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
#if defined( __sgi) || defined (__sun) || defined (__sun__) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__))
|
#ifdef __BIG_ENDIAN__
|
||||||
#define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||||
#else
|
#else
|
||||||
#define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MEMTAG1 MAKE_ID('M', 'E', 'M', 'O')
|
#define MEMTAG1 MAKE_ID('M', 'E', 'M', 'O')
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) || defined (_AIX)
|
#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) || defined (_AIX)
|
||||||
#include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
#include "STR_String.h"
|
#include "STR_String.h"
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
#include "avirgb.h"
|
#include "avirgb.h"
|
||||||
|
|
||||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
|
#ifdef __BIG_ENDIAN__
|
||||||
#define WORDS_BIGENDIAN
|
# define WORDS_BIGENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,7 @@
|
|||||||
#include "endian.h"
|
#include "endian.h"
|
||||||
#include "avi_intern.h"
|
#include "avi_intern.h"
|
||||||
|
|
||||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
|
#ifdef __BIG_ENDIAN__
|
||||||
#define WORDS_BIGENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
|
||||||
static void invert (int *num) {
|
static void invert (int *num) {
|
||||||
int new=0,i,j;
|
int new=0,i,j;
|
||||||
|
|
||||||
@@ -79,7 +75,7 @@ static void Ichunk (AviChunk *chunk) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef __BIG_ENDIAN__
|
||||||
static void Ilist (AviList *list){
|
static void Ilist (AviList *list){
|
||||||
invert (&list->fcc);
|
invert (&list->fcc);
|
||||||
invert (&list->size);
|
invert (&list->size);
|
||||||
@@ -159,10 +155,10 @@ static void Iindexe (AviIndexEntry *indexe) {
|
|||||||
invert (&indexe->Offset);
|
invert (&indexe->Offset);
|
||||||
invert (&indexe->Size);
|
invert (&indexe->Size);
|
||||||
}
|
}
|
||||||
#endif /* WORDS_BIGENDIAN */
|
#endif /* __BIG_ENDIAN__ */
|
||||||
|
|
||||||
void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int type) {
|
void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int type) {
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef __BIG_ENDIAN__
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
data = MEM_mallocN (size, "avi endian");
|
data = MEM_mallocN (size, "avi endian");
|
||||||
@@ -209,9 +205,9 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
|
|||||||
}
|
}
|
||||||
|
|
||||||
MEM_freeN (data);
|
MEM_freeN (data);
|
||||||
#else /* WORDS_BIGENDIAN */
|
#else /* __BIG_ENDIAN__ */
|
||||||
(void)movie; /* unused */
|
(void)movie; /* unused */
|
||||||
(void)type; /* unused */
|
(void)type; /* unused */
|
||||||
fwrite (datain, block, size, fp);
|
fwrite (datain, block, size, fp);
|
||||||
#endif /* WORDS_BIGENDIAN */
|
#endif /* __BIG_ENDIAN__ */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* The Original Code is: all of this file.
|
|
||||||
*
|
|
||||||
* Contributor(s): none yet.
|
|
||||||
*
|
|
||||||
* ***** END GPL LICENSE BLOCK *****
|
|
||||||
* Are we little or big endian? From Harbison&Steele.
|
|
||||||
*/
|
|
||||||
#ifndef BKE_ENDIAN_H
|
|
||||||
#define BKE_ENDIAN_H
|
|
||||||
|
|
||||||
/** \file BKE_endian.h
|
|
||||||
* \ingroup bke
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BKE_ENDIANNESS(a) returns 1 if big endian and returns 0 if little endian
|
|
||||||
*/
|
|
||||||
#define BKE_ENDIANNESS(a) { \
|
|
||||||
union { \
|
|
||||||
intptr_t l; \
|
|
||||||
char c[sizeof (intptr_t)]; \
|
|
||||||
} u; \
|
|
||||||
u.l = 1; \
|
|
||||||
a = (u.c[sizeof (intptr_t) - 1] == 1) ? 1 : 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -151,9 +151,18 @@ typedef struct Global {
|
|||||||
|
|
||||||
/* ENDIAN_ORDER: indicates what endianness the platform where the file was
|
/* ENDIAN_ORDER: indicates what endianness the platform where the file was
|
||||||
* written had. */
|
* written had. */
|
||||||
|
#if !defined( __BIG_ENDIAN__ ) && !defined( __LITTLE_ENDIAN__ )
|
||||||
|
# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined.
|
||||||
|
#endif
|
||||||
|
|
||||||
#define L_ENDIAN 1
|
#define L_ENDIAN 1
|
||||||
#define B_ENDIAN 0
|
#define B_ENDIAN 0
|
||||||
extern short ENDIAN_ORDER;
|
|
||||||
|
#ifdef __BIG_ENDIAN__
|
||||||
|
# define ENDIAN_ORDER B_ENDIAN
|
||||||
|
#else
|
||||||
|
# define ENDIAN_ORDER L_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
/* G.moving, signals drawing in (3d) window to denote transform */
|
/* G.moving, signals drawing in (3d) window to denote transform */
|
||||||
#define G_TRANSFORM_OBJ 1
|
#define G_TRANSFORM_OBJ 1
|
||||||
|
|||||||
@@ -47,18 +47,18 @@
|
|||||||
|
|
||||||
/* this weirdo pops up in two places ... */
|
/* this weirdo pops up in two places ... */
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
#ifndef O_BINARY
|
# ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
# define O_BINARY 0
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* INTEGER CODES */
|
/* INTEGER CODES */
|
||||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
|
#ifdef __BIG_ENDIAN__
|
||||||
/* Big Endian */
|
/* Big Endian */
|
||||||
#define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||||
#else
|
#else
|
||||||
/* Little Endian */
|
/* Little Endian */
|
||||||
#define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
|
#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
|
||||||
@@ -74,11 +74,11 @@
|
|||||||
#define ENDB MAKE_ID('E','N','D','B')
|
#define ENDB MAKE_ID('E','N','D','B')
|
||||||
|
|
||||||
/* Bit operations */
|
/* Bit operations */
|
||||||
#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 )
|
#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 )
|
||||||
#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 )
|
#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 )
|
||||||
#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) )
|
#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) )
|
||||||
#define BSET(a,b) ( (a) | 1<<(b) )
|
#define BSET(a,b) ( (a) | 1<<(b) )
|
||||||
#define BCLR(a,b) ( (a) & ~(1<<(b)) )
|
#define BCLR(a,b) ( (a) & ~(1<<(b)) )
|
||||||
/* bit-row */
|
/* bit-row */
|
||||||
#define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) )
|
#define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) )
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,6 @@ set(SRC
|
|||||||
BKE_depsgraph.h
|
BKE_depsgraph.h
|
||||||
BKE_displist.h
|
BKE_displist.h
|
||||||
BKE_effect.h
|
BKE_effect.h
|
||||||
BKE_endian.h
|
|
||||||
BKE_fcurve.h
|
BKE_fcurve.h
|
||||||
BKE_fluidsim.h
|
BKE_fluidsim.h
|
||||||
BKE_font.h
|
BKE_font.h
|
||||||
|
|||||||
@@ -98,7 +98,6 @@
|
|||||||
Global G;
|
Global G;
|
||||||
UserDef U;
|
UserDef U;
|
||||||
/* ListBase = {NULL, NULL}; */
|
/* ListBase = {NULL, NULL}; */
|
||||||
short ENDIAN_ORDER;
|
|
||||||
|
|
||||||
char versionstr[48]= "";
|
char versionstr[48]= "";
|
||||||
|
|
||||||
@@ -132,9 +131,6 @@ void initglobals(void)
|
|||||||
|
|
||||||
strcpy(G.ima, "//");
|
strcpy(G.ima, "//");
|
||||||
|
|
||||||
ENDIAN_ORDER= 1;
|
|
||||||
ENDIAN_ORDER= (((char*)&ENDIAN_ORDER)[0])? L_ENDIAN: B_ENDIAN;
|
|
||||||
|
|
||||||
if(BLENDER_SUBVERSION)
|
if(BLENDER_SUBVERSION)
|
||||||
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
|
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -35,11 +35,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE 0
|
# define FALSE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
#define TRUE 1
|
# define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
/* some math and copy defines */
|
/* some math and copy defines */
|
||||||
|
|
||||||
#ifndef SWAP
|
#ifndef SWAP
|
||||||
#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
|
# define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ABS(a) ( (a)<0 ? (-(a)) : (a) )
|
#define ABS(a) ( (a)<0 ? (-(a)) : (a) )
|
||||||
|
|||||||
@@ -108,12 +108,12 @@
|
|||||||
#define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff))
|
#define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff))
|
||||||
|
|
||||||
/* more endianness... should move to a separate file... */
|
/* more endianness... should move to a separate file... */
|
||||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
|
#ifdef __BIG_ENDIAN__
|
||||||
#define GET_ID GET_BIG_LONG
|
# define GET_ID GET_BIG_LONG
|
||||||
#define LITTLE_LONG SWAP_LONG
|
# define LITTLE_LONG SWAP_LONG
|
||||||
#else
|
#else
|
||||||
#define GET_ID GET_LITTLE_LONG
|
# define GET_ID GET_LITTLE_LONG
|
||||||
#define LITTLE_LONG ENDIAN_NOP
|
# define LITTLE_LONG ENDIAN_NOP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* anim.curtype, runtime only */
|
/* anim.curtype, runtime only */
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
#define ENDIAN_NOP(x) (x)
|
#define ENDIAN_NOP(x) (x)
|
||||||
|
|
||||||
#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__hppa__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__))
|
#ifdef __BIG_ENDIAN__
|
||||||
# define LITTLE_SHORT SWAP_SHORT
|
# define LITTLE_SHORT SWAP_SHORT
|
||||||
# define LITTLE_LONG SWAP_LONG
|
# define LITTLE_LONG SWAP_LONG
|
||||||
# define BIG_SHORT ENDIAN_NOP
|
# define BIG_SHORT ENDIAN_NOP
|
||||||
|
|||||||
@@ -146,16 +146,16 @@ typedef struct PreviewImage {
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
|
#ifdef __BIG_ENDIAN__
|
||||||
/* big endian */
|
/* big endian */
|
||||||
#define MAKE_ID2(c, d) ( (c)<<8 | (d) )
|
# define MAKE_ID2(c, d) ( (c)<<8 | (d) )
|
||||||
#define MOST_SIG_BYTE 0
|
# define MOST_SIG_BYTE 0
|
||||||
#define BBIG_ENDIAN
|
# define BBIG_ENDIAN
|
||||||
#else
|
#else
|
||||||
/* little endian */
|
/* little endian */
|
||||||
#define MAKE_ID2(c, d) ( (d)<<8 | (c) )
|
# define MAKE_ID2(c, d) ( (d)<<8 | (c) )
|
||||||
#define MOST_SIG_BYTE 1
|
# define MOST_SIG_BYTE 1
|
||||||
#define BLITTLE_ENDIAN
|
# define BLITTLE_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ID from database */
|
/* ID from database */
|
||||||
|
|||||||
@@ -61,16 +61,16 @@
|
|||||||
|
|
||||||
/* XXX, could be better implemented... this is for endian issues
|
/* XXX, could be better implemented... this is for endian issues
|
||||||
*/
|
*/
|
||||||
#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
|
#ifdef __BIG_ENDIAN__
|
||||||
#define RCOMP 3
|
# define RCOMP 3
|
||||||
#define GCOMP 2
|
# define GCOMP 2
|
||||||
#define BCOMP 1
|
# define BCOMP 1
|
||||||
#define ACOMP 0
|
# define ACOMP 0
|
||||||
#else
|
#else
|
||||||
#define RCOMP 0
|
# define RCOMP 0
|
||||||
#define GCOMP 1
|
# define GCOMP 1
|
||||||
#define BCOMP 2
|
# define BCOMP 2
|
||||||
#define ACOMP 3
|
# define ACOMP 3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||||
|
|||||||
Reference in New Issue
Block a user