RTP Audio System  2.0.0
tdsystem.h
Go to the documentation of this file.
00001 /*
00002  *  $Id: tdsystem.h 1314 2011-12-23 11:07:45Z dreibh $
00003  *
00004  * SocketAPI implementation for the sctplib.
00005  * Copyright (C) 1999-2012 by Thomas Dreibholz
00006  *
00007  * Realized in co-operation between
00008  * - Siemens AG
00009  * - University of Essen, Institute of Computer Networking Technology
00010  * - University of Applied Sciences, Muenster
00011  *
00012  * Acknowledgement
00013  * This work was partially funded by the Bundesministerium fuer Bildung und
00014  * Forschung (BMBF) of the Federal Republic of Germany (Foerderkennzeichen 01AK045).
00015  * The authors alone are responsible for the contents.
00016  *
00017  * This program is free software: you can redistribute it and/or modify
00018  * it under the terms of the GNU General Public License as published by
00019  * the Free Software Foundation, either version 3 of the License, or
00020  * (at your option) any later version.
00021 
00022  * This program is distributed in the hope that it will be useful,
00023  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  * GNU General Public License for more details.
00026  *
00027  * You should have received a copy of the GNU General Public License
00028  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00029  *
00030  * Contact: discussion@sctp.de
00031  *          dreibh@iem.uni-due.de
00032  *          tuexen@fh-muenster.de
00033  *
00034  * Purpose: System dependent definitions
00035  *
00036  */
00037 
00038 
00039 #ifndef TDSYSTEM_H
00040 #define TDSYSTEM_H
00041 
00042 #ifdef HAVE_CONFIG_H
00043 #include <config.h>
00044 #endif
00045 
00046 
00047 // Use traffic shaper
00048 // #define USE_TRAFFICSHAPER
00049 
00050 // Disable all warning outputs. Not recommended!
00051 // #define DISABLE_WARNINGS
00052 
00053 
00054 #include <stdio.h>
00055 #include <stdlib.h>
00056 #include <unistd.h>
00057 #include <errno.h>
00058 #include <string.h>
00059 #include <math.h>
00060 #include <iostream>
00061 
00062 
00063 // ###### Operating system definitions ######################################
00064 #define OS_Linux   1
00065 #define OS_FreeBSD 2
00066 #define OS_Darwin  3
00067 #define OS_SOLARIS 4
00068 
00069 #ifdef LINUX
00070  #define SYSTEM OS_Linux
00071 #endif
00072 #ifdef FreeBSD
00073  #define SYSTEM OS_FreeBSD
00074 #endif
00075 #ifdef DARWIN
00076  #define SYSTEM OS_Darwin
00077  #define MAXDNAME 256
00078 #endif
00079 #ifdef SOLARIS
00080  #define SYSTEM OS_SOLARIS
00081 #endif
00082 
00083 #ifndef SYSTEM
00084  #warning Variable SYSTEM with operating system name not defined! Use e.g. -DOS_Linux compiler option.
00085  #warning Trying Linux...
00086  #define SYSTEM OS_Linux
00087 #endif
00088 
00089 
00090 // ###### CPU defintions ####################################################
00091 // Set correct number of CPU bits (32 or 64) here!
00092 #if (SYSTEM == OS_Linux)
00093  #include <endian.h>
00094  #include <stdint.h>
00095 #elif (SYSTEM == OS_FreeBSD)
00096  #include <machine/endian.h>
00097  #include <inttypes.h>
00098 #elif (SYSTEM == OS_Darwin)
00099  #include <machine/endian.h>
00100  #include <stdint.h>
00101 #elif (SYSTEM == OS_SOLARIS)
00102  #include <inttypes.h>
00103  #include <arpa/nameser_compat.h>
00104 #endif
00105 
00106 
00107 // ###### Type definitions ##################################################
00111 typedef int8_t sbyte;
00112 
00116 typedef uint8_t ubyte;
00117 
00121 typedef int8_t int8;
00122 
00126 typedef uint8_t card8;
00127 
00131 typedef int16_t int16;
00132 
00136 typedef uint16_t card16;
00137 
00141 typedef int32_t int32;
00142 
00146 #if defined (int_least32_t)
00147 typedef int_least32_t integer;
00148 #else
00149 typedef int32 integer;
00150 #endif
00151 
00155 typedef uint32_t card32;
00156 
00160 typedef int64_t int64;
00161 
00165 typedef uint64_t card64;
00166 
00170 #if defined (uint_least32_t)
00171 typedef uint_least32_t cardinal;
00172 #else
00173 typedef card32 cardinal;
00174 #endif
00175 
00176 
00177 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines