hiddenid01 / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Not compiling under Solaris 9 #526

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
SunOS 5.9 on SPARC
Redis 2.2.4
gcc 3.4.6 + gmake 3.8

Following problems:

1. Need to include libresolv to have inet_aton(). 
Passed with "-lresolv".

2. Need to typedef uint64_t to "unsigned long long", did it.

3. "off_t" is typedefed to union. Which leads to:
redis-check-aof.c:151: error: incompatible types in initialization

It seems like gcc uses 
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/include/sys/types.h:145
to define it, anybody knows how I change that to something more appropriate 
(long long)?
Or do I need to hardcode it everywhere?

The snippet in case:

typedef longlong_t      off_t;

And then:

#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
typedef long long               longlong_t;
typedef unsigned long long      u_longlong_t;
#else
/* used to reserve space and generate alignment */
typedef union {
        double  _d;
        int32_t _l[2];
} longlong_t;

It seems like the bottom one is used...

Original issue reported on code.google.com by pconstan...@gmail.com on 18 Apr 2011 at 11:23