compat.h 1.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/* Icecast
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2000-2004, Jack Moffitt <jack@xiph.org, 
 *                      Michael Smith <msmith@xiph.org>,
 *                      oddsock <oddsock@xiph.org>,
 *                      Karl Heyes <karl@xiph.org>
 *                      and others (see AUTHORS for details).
 */

13 14 15
#ifndef __COMPAT_H__
#define __COMPAT_H__

16 17 18 19 20 21 22
/* compat.h
 * 
 * This file contains most of the ugliness for header portability
 * and common types across various systems like Win32, Linux and
 * Solaris.
 */

23 24 25 26
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Karl Heyes's avatar
Karl Heyes committed
27
#ifdef HAVE_UNISTD_H
28 29 30
#include <unistd.h>
#endif

Karl Heyes's avatar
Karl Heyes committed
31 32 33 34 35 36 37 38 39 40
#ifdef TIME_WITH_SYS_TIME
#  include <sys/time.h>
#  include <time.h>
#else
#  ifdef HAVE_SYS_TIME_H
#    include <sys/time.h>
#  else
#    include <time.h>
#  endif
#endif
41

42 43
/* Make sure we define 64 bit types */
#ifdef _WIN32
44 45 46
#  define PATH_SEPARATOR "\\"
#  define size_t unsigned int
#  define ssize_t int
47 48
#  define int64_t __int64
#  define uint64_t unsigned __int64
Michael Smith's avatar
Michael Smith committed
49
#  define uint32_t unsigned int
50
#  define PRIu64  "I64u"
51
#  define PRId64  "I64d"
52
#else
53
#  define PATH_SEPARATOR "/"
54
#  ifdef HAVE_STDINT_H
55
#    include <stdint.h>
56 57
#  endif
#  ifdef HAVE_INTTYPES_H
Marvin Scholz's avatar
Marvin Scholz committed
58
#    include <inttypes.h>
59 60
#  endif
#endif
61

62 63 64 65 66
/* some defaults if not provided above */
#ifndef SCNdMAX
#  define SCNdMAX "lld"
#endif

67 68
#endif /* __COMPAT_H__ */