Sat Apr 26 20:55:02 2008

Asterisk developer's documentation


compat.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- A telephony toolkit for Linux.
00003  * 
00004  * Copyright (C) 1999-2005, Mark Spencer
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * This program is free software, distributed under the terms of
00009  * the GNU General Public License
00010  */
00011 
00012 /*! \file
00013  * \brief General Definitions for Asterisk top level program
00014  */
00015 
00016 #ifndef _COMPAT_H
00017 #define _COMPAT_H
00018 
00019 #ifdef SOLARIS
00020 #define __BEGIN_DECLS
00021 #define __END_DECLS
00022 
00023 #ifndef __P
00024 #define __P(p) p
00025 #endif
00026 
00027 #include <alloca.h>
00028 #include <strings.h>
00029 #include <string.h>
00030 #include <pthread.h>
00031 #include <sys/stat.h>
00032 #include <signal.h>
00033 #include <netinet/in.h>
00034 
00035 #ifndef BYTE_ORDER
00036 #define LITTLE_ENDIAN   1234
00037 #define BIG_ENDIAN   4321
00038 
00039 #ifdef __sparc__
00040 #define BYTE_ORDER   BIG_ENDIAN
00041 #else
00042 #define BYTE_ORDER   LITTLE_ENDIAN
00043 #endif
00044 #endif
00045 
00046 #ifndef __BYTE_ORDER
00047 #define __LITTLE_ENDIAN LITTLE_ENDIAN
00048 #define __BIG_ENDIAN BIG_ENDIAN
00049 #define __BYTE_ORDER BYTE_ORDER
00050 #endif
00051 
00052 #ifndef __BIT_TYPES_DEFINED__
00053 #define __BIT_TYPES_DEFINED__
00054 typedef unsigned char   u_int8_t;
00055 typedef unsigned short  u_int16_t;
00056 typedef unsigned int u_int32_t;
00057 #endif
00058 
00059 char* strsep(char** str, const char* delims);
00060 int setenv(const char *name, const char *value, int overwrite);
00061 int unsetenv(const char *name);
00062 #endif /* SOLARIS */
00063 
00064 #ifdef __CYGWIN__
00065 #define _WIN32_WINNT 0x0500
00066 #ifndef INET_ADDRSTRLEN
00067 #define INET_ADDRSTRLEN  16
00068 #endif
00069 #ifndef INET6_ADDRSTRLEN
00070 #define INET6_ADDRSTRLEN 46
00071 #endif
00072 #endif /* __CYGWIN__ */
00073 
00074 #define HAVE_VASPRINTF
00075 #define HAVE_STRTOQ
00076 
00077 #ifdef _BSD_SOURCE
00078 #define HAVE_GETLOADAVG
00079 #endif
00080 
00081 #ifdef __linux__
00082 #define HAVE_STRCASESTR
00083 #define HAVE_STRNDUP
00084 #define HAVE_STRNLEN
00085 #endif
00086 
00087 #ifdef SOLARIS
00088 #undef HAVE_VASPRINTF
00089 #undef HAVE_STRTOQ
00090 #endif
00091 
00092 #ifdef __CYGWIN__
00093 #undef HAVE_STRTOQ
00094 typedef unsigned long long uint64_t;
00095 #endif
00096 
00097 #endif

Generated on Sat Apr 26 20:55:02 2008 for Asterisk - the Open Source PBX by  doxygen 1.5.1