File: compat.h

package info (click to toggle)
icecast2 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,560 kB
  • sloc: ansic: 34,522; sh: 5,187; makefile: 376; xml: 106; javascript: 88
file content (74 lines) | stat: -rw-r--r-- 1,651 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* 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).
 * Copyright 2018,      Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
 */

#ifndef __COMPAT_H__
#define __COMPAT_H__

/* compat.h
 * 
 * This file contains most of the ugliness for header portability
 * and common types across various systems like Win32, Linux and
 * Solaris.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#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

#ifdef _WIN32
#  define PATH_SEPARATOR "\\"
#else
#  define PATH_SEPARATOR "/"
#endif

/* Make sure we define 64 bit types */
#ifdef HAVE_STDINT_H
#  include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#  include <inttypes.h>
#endif

#if defined(_WIN32) && !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H)
#  define size_t unsigned int
#  define ssize_t int
#  define int64_t __int64
#  define uint64_t unsigned __int64
#  define int32_t __int32
#  define uint32_t unsigned __int32
#  define PRIu64  "I64u"
#  define PRId64  "I64d"
#endif

/* some defaults if not provided above */
#ifndef SCNdMAX
#  define SCNdMAX "lld"
#endif

#endif /* __COMPAT_H__ */