diff --git a/Builds/VisualStudio2012/beast.vcxproj b/Builds/VisualStudio2012/beast.vcxproj index a22b26c16..40682eac9 100644 --- a/Builds/VisualStudio2012/beast.vcxproj +++ b/Builds/VisualStudio2012/beast.vcxproj @@ -70,6 +70,7 @@ + diff --git a/Builds/VisualStudio2012/beast.vcxproj.filters b/Builds/VisualStudio2012/beast.vcxproj.filters index 18657906b..3f38cdd60 100644 --- a/Builds/VisualStudio2012/beast.vcxproj.filters +++ b/Builds/VisualStudio2012/beast.vcxproj.filters @@ -1041,6 +1041,9 @@ beast + + beast + diff --git a/beast/CStdInt.h b/beast/CStdInt.h new file mode 100644 index 000000000..3c498f1db --- /dev/null +++ b/beast/CStdInt.h @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +/* + This file is part of Beast: https://github.com/vinniefalco/Beast + Copyright 2013, Vinnie Falco + + Portions of this file are from JUCE. + Copyright (c) 2013 - Raw Material Software Ltd. + Please visit http://www.juce.com + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef BEAST_CSTDINT_H_INCLUDED +#define BEAST_CSTDINT_H_INCLUDED + +#include "Config.h" + +namespace beast +{ + +typedef signed char int8; +typedef signed short int16; +typedef signed int int32; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; + +#if BEAST_MSVC + typedef __int64 int64; + typedef unsigned __int64 uint64; + + /** A platform-independent macro for writing 64-bit literals, needed because + different compilers have different syntaxes for this. + + E.g. writing literal64bit (0x1000000000) will translate to 0x1000000000LL for + GCC, or 0x1000000000 for MSVC. + */ + #define literal64bit(longLiteral) ((__int64) longLiteral) + +#else + /** A platform-independent 64-bit integer type. */ + typedef long long int64; + /** A platform-independent 64-bit unsigned integer type. */ + typedef unsigned long long uint64; + /** A platform-independent macro for writing 64-bit literals, needed because + different compilers have different syntaxes for this. + + E.g. writing literal64bit (0x1000000000) will translate to 0x1000000000LL for + GCC, or 0x1000000000 for MSVC. + */ + #define literal64bit(longLiteral) (longLiteral##LL) + +#endif + +#if BEAST_64BIT + /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ + typedef int64 pointer_sized_int; + /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ + typedef uint64 pointer_sized_uint; +#elif BEAST_MSVC + /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ + typedef _W64 int pointer_sized_int; + /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ + typedef _W64 unsigned int pointer_sized_uint; +#else + /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ + typedef int pointer_sized_int; + /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ + typedef unsigned int pointer_sized_uint; +#endif + +#if BEAST_MSVC + typedef pointer_sized_int ssize_t; +#endif + +} + +#endif diff --git a/modules/beast_core/beast_core.h b/modules/beast_core/beast_core.h index c6943aab0..3e1a26686 100644 --- a/modules/beast_core/beast_core.h +++ b/modules/beast_core/beast_core.h @@ -224,6 +224,8 @@ Some files contain portions of these external projects, licensed separately: //------------------------------------------------------------------------------ +#include "../../beast/CStdInt.h" + namespace beast { diff --git a/modules/beast_core/maths/MathsFunctions.h b/modules/beast_core/maths/MathsFunctions.h index 6532951c4..4ccd4eab5 100644 --- a/modules/beast_core/maths/MathsFunctions.h +++ b/modules/beast_core/maths/MathsFunctions.h @@ -24,75 +24,6 @@ #ifndef BEAST_MATHSFUNCTIONS_H_INCLUDED #define BEAST_MATHSFUNCTIONS_H_INCLUDED -//============================================================================== -/* - This file sets up some handy mathematical typdefs and functions. -*/ - -//============================================================================== -// Definitions for the int8, int16, int32, int64 and pointer_sized_int types. - -/** A platform-independent 8-bit signed integer type. */ -typedef signed char int8; -/** A platform-independent 8-bit unsigned integer type. */ -typedef unsigned char uint8; -/** A platform-independent 16-bit signed integer type. */ -typedef signed short int16; -/** A platform-independent 16-bit unsigned integer type. */ -typedef unsigned short uint16; -/** A platform-independent 32-bit signed integer type. */ -typedef signed int int32; -/** A platform-independent 32-bit unsigned integer type. */ -typedef unsigned int uint32; - -#if BEAST_MSVC - /** A platform-independent 64-bit integer type. */ - typedef __int64 int64; - /** A platform-independent 64-bit unsigned integer type. */ - typedef unsigned __int64 uint64; - /** A platform-independent macro for writing 64-bit literals, needed because - different compilers have different syntaxes for this. - - E.g. writing literal64bit (0x1000000000) will translate to 0x1000000000LL for - GCC, or 0x1000000000 for MSVC. - */ - #define literal64bit(longLiteral) ((__int64) longLiteral) -#else - /** A platform-independent 64-bit integer type. */ - typedef long long int64; - /** A platform-independent 64-bit unsigned integer type. */ - typedef unsigned long long uint64; - /** A platform-independent macro for writing 64-bit literals, needed because - different compilers have different syntaxes for this. - - E.g. writing literal64bit (0x1000000000) will translate to 0x1000000000LL for - GCC, or 0x1000000000 for MSVC. - */ - #define literal64bit(longLiteral) (longLiteral##LL) -#endif - - -#if BEAST_64BIT - /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ - typedef int64 pointer_sized_int; - /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ - typedef uint64 pointer_sized_uint; -#elif BEAST_MSVC - /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ - typedef _W64 int pointer_sized_int; - /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ - typedef _W64 unsigned int pointer_sized_uint; -#else - /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ - typedef int pointer_sized_int; - /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ - typedef unsigned int pointer_sized_uint; -#endif - -#if BEAST_MSVC - typedef pointer_sized_int ssize_t; -#endif - //============================================================================== // Some indispensible min/max functions