X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2Fprivate.h;h=f2458c6c07e930d7d64f830112b1b2a5b80a535a;hb=25e3d5e35a7fd7efdffc420efe3c41a91cefe43f;hp=a79c33d32aa1630a752b091975db473c0d8cac93;hpb=0cca0c495c7dc29d134a10d7eed5de1f377c99bf;p=lugaru.git diff --git a/Source/private.h b/Source/private.h index a79c33d..f2458c6 100644 --- a/Source/private.h +++ b/Source/private.h @@ -1,3 +1,24 @@ +/* +Copyright (C) 2003, 2010 - Wolfire Games + +This file is part of Lugaru. + +Lugaru is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + #ifndef private_h #define private_h @@ -17,6 +38,8 @@ #define BinIO_HOST_BYTE_ORDER 'H' #define BinIO_NETWORK_BYTE_ORDER 'N' +#ifndef ALREADY_DID_BINIO_STDINT +#define ALREADY_DID_BINIO_STDINT #if defined(BinIO_STDINT_HEADER) #include BinIO_STDINT_HEADER typedef float float32_t; @@ -26,13 +49,14 @@ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifdef WIN32 - typedef unsigned __int64 uint64_t; +typedef unsigned __int64 uint64_t; #else - typedef unsigned long long uint64_t; +typedef unsigned long long uint64_t; #endif typedef float float32_t; typedef double float64_t; #endif +#endif #ifndef BinIO_INLINE #if defined(__GNUC__) @@ -83,15 +107,12 @@ BinIO_INLINE void BinIOSwap8(const uint8_t *src, uint8_t *dst) BinIO_INLINE int BinIONormalizeByteOrder(int byte_order) { - if (byte_order == BinIO_HOST_BYTE_ORDER) - { + if (byte_order == BinIO_HOST_BYTE_ORDER) { byte_order = BinIO_BYTE_ORDER; - } - else if (byte_order == BinIO_NETWORK_BYTE_ORDER) - { + } else if (byte_order == BinIO_NETWORK_BYTE_ORDER) { byte_order = BinIO_BIG_ENDIAN_BYTE_ORDER; } - + return byte_order; } @@ -108,8 +129,7 @@ extern void BinIOConvert8(int from_byte_order, int to_byte_order, const uint8_t *src, uint8_t *dst, unsigned int count); -struct BinIOFormatCursor -{ +struct BinIOFormatCursor { const char *cursor; int byte_order; int count; @@ -132,3 +152,4 @@ extern void BinIOCountBytes(void *context, int type, int byte_order, int count); extern size_t BinIOFormatByteCount(const char *format); #endif +