coan 4.2.4
platform.h
Go to the documentation of this file.
00001 #ifndef PLATFORM_H
00002 #define PLATFORM_H
00003 /***************************************************************************
00004  *   Copyright (C) 2004, 2006 Symbian Software Ltd.                        *
00005  *   All rights reserved.                                                  *
00006  *   Copyright (C) 2007-2011 Mike Kinghan, imk@strudl.org                  *
00007  *   All rights reserved.                                                  *
00008  *                                                                         *
00009  *   Contributed originally by Mike Kinghan, imk@strudl.org                *
00010  *                                                                         *
00011  *   Redistribution and use in source and binary forms, with or without    *
00012  *   modification, are permitted provided that the following conditions    *
00013  *   are met:                                                              *
00014  *                                                                         *
00015  *   Redistributions of source code must retain the above copyright        *
00016  *   notice, this list of conditions and the following disclaimer.         *
00017  *                                                                         *
00018  *   Redistributions in binary form must reproduce the above copyright     *
00019  *   notice, this list of conditions and the following disclaimer in the   *
00020  *   documentation and/or other materials provided with the distribution.  *
00021  *                                                                         *
00022  *   Neither the name of Symbian Software Ltd. nor the names of its        *
00023  *   contributors may be used to endorse or promote products derived from  *
00024  *   this software without specific prior written permission.              *
00025  *                                                                         *
00026  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   *
00027  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     *
00028  *   LIMITED TO, THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS    *
00029  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE        *
00030  *   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,   *
00031  *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,  *
00032  *   BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
00033  *   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    *
00034  *   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
00035  *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
00036  *   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  *
00037  *   DAMAGE.                                                               *
00038  *                                                                         *
00039  **************************************************************************/
00040 
00041 #include "opts.h"
00042 
00046 #if defined(_WIN32) || defined(_WIN64)
00047 
00049 #define PATH_DELIM '\\'
00050 
00052 #define FS_ROOT_PREFIX ""
00053 
00055 #ifdef _WIN64
00056 #define OS_TYPE "64 bit Windows"
00057 #else
00058 #define OS_TYPE "32 bit Windows"
00059 #endif
00060 
00062 #define WINDOWS
00063 
00065 #define STRICMP         _stricmp
00066 
00067 #define STRNICMP        _strnicmp
00068 
00069 #include <stdlib.h>
00070 
00072 #ifndef PATH_MAX
00073 #define PATH_MAX _MAX_PATH
00074 #endif
00075 
00076 #ifdef __GNUC__
00077 
00078 #define GNUWIN
00079 #ifdef _WIN32
00080 #define GNUWIN32
00081 #endif
00082 #ifdef _WIN64
00083 #define GNUWIN64
00084 #endif
00085 #endif
00086 
00087 #else /* ! _WIN32 || _WIN64*/
00088 
00090 #define PATH_DELIM '/'
00091 
00093 #define FS_ROOT_PREFIX "/"
00094 
00096 #ifdef __LP64__
00097 #define OS_TYPE "64 bit Unix/Linux"
00098 #else
00099 #define OS_TYPE "32 bit Unix/Linux"
00100 #endif
00101 
00102 
00104 #define NIX
00105 
00107 #define STRICMP  strcasecmp
00108 
00109 #define STRNICMP strncasecmp
00110 
00111 /* This must appear before any system headers are included */
00112 #if __STDC_VERSION__ >= 199901L
00113 #define _XOPEN_SOURCE 600
00114 #else
00115 #define _XOPEN_SOURCE 500
00116 #endif /* __STDC_VERSION__ */
00117 
00118 /* POSIX header for strcasecmp() and strncasecmp() */
00119 #ifdef HAVE_STRINGS_H
00120 #include <strings.h>
00121 #endif
00122 
00123 #include <limits.h>
00124 
00125 #endif
00126 
00127 #include <stdio.h>
00128 
00129 #endif
00130 /* EOF*/
00131 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines