#define __PORTABLE_H
#include <string.h>
-#ifndef __GNU_C__ // MSVC
-typedef __int16 INT16;
-typedef unsigned __int16 UINT16;
-typedef __int32 INT32;
-typedef unsigned __int32 UINT32;
-typedef __int64 INT64;
-typedef unsigned __int64 UINT64;
-typedef ptrdiff_t UINT_PTR;
-typedef __int32 INT;
-#else // gcc
#include <stdint.h>
+
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT32;
typedef uint64_t UINT64;
typedef uintptr_t UINT_PTR;
typedef int32_t INT;
-#endif
typedef signed char INT8;
typedef unsigned char UINT8;
\r
//#define DISABLE_RLZ\r
\r
+#include <stdint.h>\r
\r
#define APPNAME "Rcomage"\r
#define APPNAME_VER "Rcomage v1.1.1"\r
#define ALIGN_TO_4(n) (((n) + 3) & (~3))\r
//#define ALIGN_TO_4(n) (((n) + 3) >>2 <<2) // problem: upper 2 bits gets wiped too\r
\r
-#ifndef __GNU_C__\r
-typedef unsigned __int8 uint8;\r
-typedef __int8 int8;\r
-typedef unsigned __int16 uint16;\r
-typedef __int16 int16;\r
-typedef unsigned __int32 uint32;\r
-typedef __int32 int32;\r
-#else\r
-#include <stdint.h>\r
typedef uint8_t uint8;\r
typedef int8_t int8;\r
typedef uint16_t uint16;\r
typedef int16_t int16;\r
typedef uint32_t uint32;\r
typedef int32_t int32;\r
-#endif\r
-\r
\r
const uint32 UTF8_BOM = 0xBFBBEF;\r
const uint16 UTF16_BOM = 0xFEFF;\r
const uint32 UTF32_BOM = 0x0000FEFF;\r
\r
\r
-#ifndef __GNU_C__ /* msvc */\r
-#define PACK_STRUCT(nam, struc) typedef struct struc nam\r
-// need to use pragma directives whenever we use it...\r
-#else /* gcc */\r
#define PACK_STRUCT(nam, struc) typedef struct struc __attribute__ ((packed)) nam\r
-#endif\r
-\r
\r
\r
uint zlib_compress(void* src, uint srcLen, void* dest, uint destLen, int level, int strat);\r
\r
void get_temp_fname(char* out, const char* ext);\r
\r
-/*\r
-#ifndef Z_OK\r
-#define Z_OK 0\r
-#endif\r
-#ifndef Z_DATA_ERROR\r
-#define Z_DATA_ERROR -3\r
-#endif\r
-*/\r
#define Z_USE_7Z 10\r
\r
#ifdef WIN32\r
#include <stdlib.h>\r
#include <math.h>\r
#include <stdio.h>\r
-\r
-#ifndef __GNU_C__ // MSVC\r
-typedef __int64 int64_t;\r
-#else\r
#include <stdint.h>\r
-#endif\r
\r
#define RLZI_WINDOW_SIZE 0x7FED // *4 = 130,996 bytes (128KB - 76 bytes)\r
#define RLZI_DICTIONARY_SIZE 0x3FFFF // *4 = 1,048,572 bytes (1MB - 4 bytes)\r
\r
#define ROUND(x) ((int)(x<0 ? x-0.5 : x+0.5))\r
\r
-#ifndef __GNU_C__\r
-#pragma pack(push, 4)\r
-#pragma pack(1)\r
-#endif\r
\r
#define VAG_SIGNATURE 0x70474156\r
#define VAG_VERSION 0x4000000 //0x2000000\r
uint32 s2sig; // "data"\r
uint32 s2size; // = numSamples * channels * bitDepth/8 OR size-36\r
});\r
-#ifndef __GNU_C__\r
-#pragma pack(pop)\r
-#endif\r
\r
\r
// TODO: sanity checks with lengths\r