Details Ticket 5391


Comment | Reply | Take | Open


Serial Number 5391
Subject Add dual-arch static copy of portable.h
Area wish6
Queue grass
Requestors kyngchaos@kyngchaos.com
Owner none
Status resolved
Last User Contact Wed Feb 14 19:22:38 2007 (2 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Wed Feb 14 19:22:38 2007 (2 yr ago)
Created Fri Dec 15 16:16:20 2006 (2 yr ago)

Transaction History Ticket 5391


Fri, Dec 15 2006 16:16:20    Request created by guest  
Subject: Add dual-arch static copy of portable.h

Platform: Mac OSX
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 6.3.CVS.20061202

Another one for building Mac OS X universal binaries.  lib/vector/diglib/portable.h
for universal OS 
X.  I've simply taken a Pac PPC and Intel copy and merged them together.  The
correct version is 
chosen by a #ifdef based on a Mac standard __LITTLE_ENDIAN__ macro.  This will
work in an all-at-
once universal build (specifying ppc and intel architectures on the same compile
command) since 
internally they are compiled separately, then joined, and so headers are processed
for each arch.

I didn't work out makefile changes, but it would be something like the MINGW
ifdef in the diglib 
makefile.  This would also need a platform.make setting to say it's a Mac build,
and configure logic 
to set it.

suggested lib/vector/diglib/portable/universal-macosx-gcc.h to be copied to portable.h
at build 
time:


/* Architecture: universal-apple-darwin */

/* Native machine sizes */
#define NATIVE_DOUBLE 8
#define NATIVE_FLOAT  4
#define NATIVE_LONG   4
#define NATIVE_INT    4
#define NATIVE_SHORT  2
#define NATIVE_CHAR   1

#ifdef __LITTLE_ENDIAN__

/* Native machine byte orders */
#define DOUBLE_ORDER 0
#define FLOAT_ORDER  0
#define LONG_ORDER   0
#define INT_ORDER    0
#define SHORT_ORDER  0


/* Translation matrices from little endian to native */

/* Double format: */
static int dbl_cnvrt[] = {7, 6, 5, 4, 3, 2, 1, 0};

/* Float format : */
static int flt_cnvrt[] = {3, 2, 1, 0};

/* Long format  : */
static int lng_cnvrt[] = {3, 2, 1, 0};

/* Int format  : */
static int int_cnvrt[] = {3, 2, 1, 0};

/* Short format : */
static int shrt_cnvrt[] = {1, 0};

#else

/* Native machine byte orders */
#define DOUBLE_ORDER 1
#define FLOAT_ORDER  1
#define LONG_ORDER   1
#define INT_ORDER    1
#define SHORT_ORDER  1


/* Translation matrices from big endian to native */

/* Double format: */
static int dbl_cnvrt[] = {0, 1, 2, 3, 4, 5, 6, 7};

/* Float format : */
static int flt_cnvrt[] = {0, 1, 2, 3};

/* Long format  : */
static int lng_cnvrt[] = {0, 1, 2, 3};

/* Int format  : */
static int int_cnvrt[] = {0, 1, 2, 3};

/* Short format : */
static int shrt_cnvrt[] = {0, 1};

#endif
Wed, Feb 14 2007 19:22:38    Status changed to resolved by msieczka  
Wed, Feb 14 2007 19:22:38    Mail sent by msieczka  
According to William, this wish is a duplicate of his patch in
http://wald.intevation.org/tracker/?func=detail&atid=205&aid=291&group_id=21.
Closing this one then, let's continue it via GForge.

Maciek
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request