*** ./md5.h.ORIG Wed Apr 13 17:34:01 2011 --- ./md5.h Wed Apr 13 17:34:16 2011 *************** *** 25,31 **** --- 25,33 ---- #ifndef _MD5_H #define _MD5_H 1 + #ifndef _AIX51 #include + #endif #include "lrzip_private.h" *** ./sha4.h.ORIG Wed Apr 13 17:34:24 2011 --- ./sha4.h Wed Apr 13 17:34:42 2011 *************** *** 26,31 **** --- 26,35 ---- #ifndef POLARSSL_SHA4_H #define POLARSSL_SHA4_H + #ifdef _AIX + #include + #endif + #if defined(_MSC_VER) || defined(__WATCOMC__) #define UL64(x) x##ui64 #define int64 __int64 *** ./zpipe.cpp.ORIG Wed Apr 13 17:34:52 2011 --- ./zpipe.cpp Wed Apr 13 17:35:22 2011 *************** *** 1486,1501 **** int ph, pm; // sizes of H and M in z ZPAQL z; // holds PCOMP public: ! PostProcessor(ZPAQL& hz); void set(FILE* out, SHA1* p) {z.output=out; z.sha1=p;} // Set output void write(int c); // Input a byte }; // Copy ph, pm from block header ! PostProcessor::PostProcessor(ZPAQL& hz) { state=0; ! ph=hz.header[4]; ! pm=hz.header[5]; } // (PASS=0 | PROG=1 psize[0..1] pcomp[0..psize-1]) data... EOB=-1 --- 1486,1501 ---- int ph, pm; // sizes of H and M in z ZPAQL z; // holds PCOMP public: ! PostProcessor(ZPAQL& AIXhz); void set(FILE* out, SHA1* p) {z.output=out; z.sha1=p;} // Set output void write(int c); // Input a byte }; // Copy ph, pm from block header ! PostProcessor::PostProcessor(ZPAQL& AIXhz) { state=0; ! ph=AIXhz.header[4]; ! pm=AIXhz.header[5]; } // (PASS=0 | PROG=1 psize[0..1] pcomp[0..psize-1]) data... EOB=-1 *** ./lrzip_private.h.ORIG Wed Apr 13 17:35:32 2011 --- ./lrzip_private.h Wed Apr 13 17:36:33 2011 *************** *** 24,30 **** --- 24,32 ---- #define STREAM_BUFSIZE (1024 * 1024 * 10) #include + #ifndef _AIX51 #include + #endif #include #ifdef HAVE_STRING_H # include *************** *** 81,88 **** --- 83,95 ---- extern int errno; #endif + #ifdef __GNUC__ #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) + #else + #define likely(cond) (cond) + #define unlikely(cond) (cond) + #endif typedef long long int i64; typedef uint32_t u32; *************** *** 91,97 **** typedef struct md5_ctx md5_ctx; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ ! defined(__APPLE__) || defined(__CYGWIN__) #define mremap fake_mremap #endif --- 98,104 ---- typedef struct md5_ctx md5_ctx; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ ! defined(__APPLE__) || defined(__CYGWIN__) || defined(_AIX) #define mremap fake_mremap #endif *** ./util.c.ORIG Wed Apr 13 17:36:43 2011 --- ./util.c Wed Apr 13 17:36:59 2011 *************** *** 41,51 **** --- 41,53 ---- #endif #include + #ifndef _AIX #ifdef _SC_PAGE_SIZE # define PAGE_SIZE (sysconf(_SC_PAGE_SIZE)) #else # define PAGE_SIZE (4096) #endif + #endif #include #include *** ./stream.c.ORIG Wed Apr 13 17:37:10 2011 --- ./stream.c Wed Apr 13 17:38:00 2011 *************** *** 58,64 **** #include "lrzip.h" ! #ifdef __APPLE__ # define fmemopen fake_fmemopen # define open_memstream fake_open_memstream # define memstream_update_buffer fake_open_memstream_update_buffer --- 58,64 ---- #include "lrzip.h" ! #if defined(__APPLE__) || defined(_AIX) # define fmemopen fake_fmemopen # define open_memstream fake_open_memstream # define memstream_update_buffer fake_open_memstream_update_buffer *** ./main.c.ORIG Tue Jul 26 10:00:54 2011 --- ./main.c Tue Jul 26 10:01:19 2011 *************** *** 145,150 **** --- 145,158 ---- return ramsize; } + #elif _AIX + static inline i64 get_ram(void) + { + i64 ramsize; + + ramsize = (i64)sysconf(_SC_PHYS_PAGES) * (i64)sysconf(_SC_PAGE_SIZE); + return ramsize; + } #else /* __APPLE__ */ static inline i64 get_ram(void) {