[postgis-users] Building Postgres under FreeBSD 4.7

Norman Vine nhv at cape.com
Mon Mar 24 10:28:37 PST 2003



> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of
> Norman Vine
> Sent: Monday, March 24, 2003 1:07 PM
> To: PostGIS Users Discussion
> Subject: RE: [postgis-users] Building Postgres under FreeBSD 4.7
>
>
> Benjamin Thelen
> >
> > I've found entries of LITTLE_ENDIAN and BYTE_ORDER. But I don't know
> > what to do with this.
> > So I definitely took the wrong make utility, but it still does not
> > succeed.
> >
> >
> > I found a posting in the mailing list:
> > http://postgis.refractions.net/pipermail/postgis-users/2002-March/000817
> > .html
> >
> > I found that I have to declare the following at the top of postgis.h
> >
> > #define                 BIG_ENDIAN              4321
> > #define                 LITTLE_ENDIAN   1234
> >
> > I did so and got the following messages of gmake below. Why are those
> > numbers 4321 and 1234? That seems to be a little strange. What are those
> > entries and why are they missing in the default source code?
> > Well just one Error left, the guy who wrote this posting was happy just
> > to have one error.
> > Is the installation of postgis now done? How can I check it?
>
> see
> http://www.cs.umass.edu/~verts/cs32/endian.html
>
> The following code will test your machine if the above is not sufficient
>
> HTH
>
> Norman

Lets try that again :-)

=== cut ====

#include <stdio.h>

int main(int argc, char **argv) {
    static const int _EndianTest = 1;
#define IsLittleEndian (*((char *) &_EndianTest ) != 0)
#define IsBigEndian    (*((char *) &_EndianTest ) == 0)

    if( IsLittleEndian )
        printf("LITTLE_ENDIAN\n");
    else if( IsBigEndian )
        printf("BIG_ENDIAN\n");
    else
        printf("Something is wrong\n");
}




More information about the postgis-users mailing list