os.h

Go to the documentation of this file.
00001 /*
00002  *      Compatibility stuff among operating systems and compilers.
00003  *
00004  *      Copyright (c) 2005-2007 Naoaki Okazaki
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00019  *
00020  */
00021 
00022 /* $Id: os.h 328 2007-02-10 17:50:11Z nyaochi $ */
00023 
00024 #ifndef __OS_H__
00025 #define __OS_H__
00026 
00027 #ifdef  _MSC_VER
00028 #define HAVE_STRING_H 1
00029 #endif/*_MSC_VER*/
00030 
00031 #if             _MSC_VER >= 1400
00032 #define _CRT_SECURE_NO_DEPRECATE        1       /* Use 'unsafe' CRT routines. */
00033 #endif/*_MSC_VER*/
00034 
00035 #include <stdio.h>
00036 #include <pmplib/os_types.h>
00037 
00038 
00039 #if             defined(WIN32)
00040 #define fileno          _fileno
00041 #define strnicmp        _strnicmp
00042 #define snprintf        _snprintf
00043 #define snwprintf       _snwprintf
00044 #define strdup          _strdup
00045 #define getcwd          _getcwd
00046 #define alloca          _alloca
00047 #define strnicmp        _strnicmp
00048 
00049 #define PATHCHAR        '\\'
00050 #define PATHSTR         "\\"
00051 
00052 #else
00053 
00057 #define PATHCHAR        '/'
00058 
00062 #define PATHSTR         "/"
00063 
00064 #endif
00065 
00066 #if             defined(WIN32)
00067 #include <windows.h>
00068 
00069 #elif   defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
00070 #include <sys/param.h>
00071 #define MAX_PATH        MAXPATHLEN
00072 
00073 #else
00074 #include <limits.h>
00075 #define MAX_PATH        PATH_MAX
00076 
00077 #endif
00078 
00079 #endif/*__OS_H__*/