Home | History | Annotate | Download | only in lib
      1 /*
      2  * Copyright (C) 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 /**
     17  * @file picopltf.h
     18  *
     19  * Header file (only) to define platform symbols.
     20  *
     21  * Refer to http://predef.sourceforge.net/ for a comprehensive list
     22  * of pre-defined C/C++ compiler macros.
     23  *
     24  * Copyright (C) 2008-2009 SVOX AG, Baslerstr. 30, 8048 Zuerich, Switzerland
     25  * All rights reserved.
     26  *
     27  * History:
     28  * - 2009-04-20 -- initial version
     29  */
     30 
     31 #if !defined(__PICOPLTF_H__)
     32 #define __PICOPLTF_H__
     33 
     34 #define ENDIANNESS_BIG 1
     35 #define ENDIANNESS_LITTLE 2
     36 
     37 /* * platform identifiers ***/
     38 #define PICO_Windows    1   /* Windows */
     39 #define PICO_MacOSX     5   /* Macintosh OS X */
     40 #define PICO_Linux      7   /* Linux */
     41 
     42 /* * definition of current platform ***/
     43 #if !defined(PICO_PLATFORM)
     44 #if defined(_WIN32)
     45 #define PICO_PLATFORM    PICO_Windows
     46 #elif defined(__APPLE__) && defined(__MACH__)
     47 #define PICO_PLATFORM    PICO_MacOSX
     48 #elif defined(linux) || defined(__linux__) || defined(__linux)
     49 #define PICO_PLATFORM    PICO_Linux
     50 #else
     51 #error PICO_PLATFORM not defined
     52 #endif
     53 #endif /* !defined(PICO_PLATFORM) */
     54 
     55 
     56 /* * symbol PICO_PLATFORM_STRING to define platform as string ***/
     57 #if (PICO_PLATFORM == PICO_Windows)
     58 #define PICO_PLATFORM_STRING "Windows"
     59 #elif (PICO_PLATFORM == PICO_MacOSX)
     60 #define PICO_PLATFORM_STRING "MacOSX"
     61 #elif (PICO_PLATFORM == PICO_Linux)
     62 #define PICO_PLATFORM_STRING "Linux"
     63 #elif (PICO_PLATFORM == PICO_GENERIC)
     64 #define PICO_PLATFORM_STRING "UnknownPlatform"
     65 #endif
     66 
     67 #if (PICO_PLATFORM == PICO_MacOSX)
     68 #define PICO_ENDIANNESS ENDIANNESS_BIG
     69 #else
     70 #define PICO_ENDIANNESS ENDIANNESS_LITTLE
     71 #endif
     72 
     73 #endif /* !defined(__PICOPLTF_H__) */
     74