00001 //----------------------------------------------------------------------------- 00002 // Project : SDK Core 00003 // Version : 1.0 00004 // 00005 // Category : SDK Core Interfaces 00006 // Filename : fplatform.h 00007 // Created by : Steinberg, 01/2004 00008 // Modified : $Date: 2008/01/10 10:36:29 $ 00009 // Description : Detect platform and set define 00010 // 00011 //----------------------------------------------------------------------------- 00012 // LICENSE 00013 // © 2008, Steinberg Media Technologies GmbH, All Rights Reserved 00014 //----------------------------------------------------------------------------- 00015 // This Software Development Kit may not be distributed in parts or its entirety 00016 // without prior written agreement by Steinberg Media Technologies GmbH. 00017 // This SDK must not be used to re-engineer or manipulate any technology used 00018 // in any Steinberg or Third-party application or software module, 00019 // unless permitted by law. 00020 // Neither the name of the Steinberg Media Technologies nor the names of its 00021 // contributors may be used to endorse or promote products derived from this 00022 // software without specific prior written permission. 00023 // 00024 // THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND 00025 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00026 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00027 // IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, 00028 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00029 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00030 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00031 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00032 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 00033 // OF THE POSSIBILITY OF SUCH DAMAGE. 00034 //------------------------------------------------------------------------------ 00035 00036 #ifndef __fplatform__ 00037 #define __fplatform__ 00038 00039 #define kLittleEndian 0 00040 #define kBigEndian 1 00041 00042 #undef WINDOWS 00043 #undef MAC 00044 #undef MOTIF 00045 #undef BEOS 00046 00047 #if defined (_WIN32) // WIN32 AND WIN64 00048 #define WINDOWS 1 00049 #define BYTEORDER kLittleEndian 00050 00051 // deprecated insecure calls (strcpy, memset etc) 00052 #pragma warning (disable : 4996) 00053 00054 #if defined (_WIN64) // WIN64 only 00055 #define PLATFORM_64 1 00056 #else 00057 #ifndef WIN32_LEAN_AND_MEAN // WIN32 only 00058 // make windows.h smaller 00059 #define WIN32_LEAN_AND_MEAN 1 00060 #endif 00061 #endif 00062 #ifndef WIN32 00063 #define WIN32 1 00064 #endif 00065 #elif __UNIX__ // SGI IRIX 00066 #define MOTIF 1 00067 #if LINUX 00068 #define BYTEORDER kLittleEndian 00069 #else 00070 #define BYTEORDER kBigEndian 00071 #endif 00072 #elif __INTEL__ // BeOS 00073 #define BEOS 1 00074 #define BYTEORDER kLittleEndian 00075 #else // Mac 00076 #define MAC 1 00077 #define PTHREADS 1 00078 #ifndef __CF_USE_FRAMEWORK_INCLUDES__ 00079 #define __CF_USE_FRAMEWORK_INCLUDES__ 00080 #endif 00081 #ifndef TARGET_API_MAC_CARBON 00082 #define TARGET_API_MAC_CARBON 1 00083 #endif 00084 #if __LP64__ 00085 #define PLATFORM_64 1 00086 #endif 00087 #if __MWERKS__ 00088 #define BYTEORDER kBigEndian 00089 #else 00090 #if defined (__BIG_ENDIAN__) 00091 #define BYTEORDER kBigEndian 00092 #else 00093 #define BYTEORDER kLittleEndian 00094 #endif 00095 #endif 00096 #endif 00097 00098 #endif