Files
wagic/JGE/src/zipFS/stdint_old.h
wagic.the.homebrew e27cf56fa2 - Support for Zip Filesystem. It is now possible to zip the entire Res folder ("store" method preferred, zip so that the root of the zip has ai, player, etc...) in one single file for read only. Write access is done in another folder (hardcoded to be User/ for now, can be updated depending on platforms, etc...
-- zipFS has several limitations...
--- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem.
--- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string.

-- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android.
-- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out
-- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem
-- I haven't tested options/profiles in a deep way, it is possible I broke that.
2011-08-21 09:04:59 +00:00

77 lines
2.1 KiB
C

#ifndef _ZIPFS_STDINT_H_
#define _ZIPFS_STDINT_H_
#include "static_assert.h"
#if defined _MSC_VER
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;
typedef signed short int_least16_t;
typedef unsigned short uint_least16_t;
typedef signed int int_least32_t;
typedef unsigned int uint_least32_t;
typedef signed __int64 int_least64_t;
typedef unsigned __int64 uint_least64_t;
#elif defined UNIX
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;
typedef signed short int_least16_t;
typedef unsigned short uint_least16_t;
typedef signed int int_least32_t;
typedef unsigned int uint_least32_t;
typedef signed long long int_least64_t;
typedef unsigned long long uint_least64_t;
#endif
inline void __CheckSizedTypes()
{
// one byte must be exactly 8 bits
//static_assert(CHAR_BIT == 8);
mstatic_assert(sizeof(int8_t) == 1);
mstatic_assert(sizeof(uint8_t) == 1);
mstatic_assert(sizeof(int16_t) == 2);
mstatic_assert(sizeof(uint16_t) == 2);
mstatic_assert(sizeof(int32_t) == 4);
mstatic_assert(sizeof(uint32_t) == 4);
mstatic_assert(sizeof(int64_t) == 8);
mstatic_assert(sizeof(uint64_t) == 8);
mstatic_assert(sizeof(int_least8_t) >= 1);
mstatic_assert(sizeof(uint_least8_t) >= 1);
mstatic_assert(sizeof(int_least16_t) >= 2);
mstatic_assert(sizeof(uint_least16_t) >= 2);
mstatic_assert(sizeof(int_least32_t) >= 4);
mstatic_assert(sizeof(uint_least32_t) >= 4);
mstatic_assert(sizeof(int_least64_t) >= 8);
mstatic_assert(sizeof(uint_least64_t) >= 8);
}
#endif