compat.h 1.26 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 27 28 29
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif


30 31
/* Make sure we define 64 bit types */
#ifdef _WIN32
32 33 34
#  define PATH_SEPARATOR "\\"
#  define size_t unsigned int
#  define ssize_t int
35 36
#  define int64_t __int64
#  define uint64_t unsigned __int64
Michael Smith's avatar
Michael Smith committed
37
#  define uint32_t unsigned int
38
#else
39
#  define PATH_SEPARATOR "/"
40
#  if defined(HAVE_STDINT_H)
41
#    include <stdint.h>
42 43
#  elif defined(HAVE_INTTYPES_H)
#    include <inttypes.h>
44 45
#  endif
#endif
46 47 48

#ifdef _WIN32
#define FORMAT_INT64      "%I64d"
49
#define FORMAT_UINT64     "%I64u"
50 51
#else
#define FORMAT_INT64      "%lld"
52
#define FORMAT_UINT64     "%llu"
53 54 55 56
#endif

#endif /* __COMPAT_H__ */