Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 2.02 KB

File metadata and controls

78 lines (61 loc) · 2.02 KB
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _OS_H
#define _OS_H
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
********************************************************************/
Oct 6, 2019
Oct 6, 2019
20
#ifdef HAVE_CONFIG_H
Dec 1, 2019
Dec 1, 2019
21
# include "config.h"
Oct 6, 2019
Oct 6, 2019
22
23
#endif
24
25
26
27
28
29
30
31
#include <math.h>
#include <ogg/os_types.h>
#ifndef _V_IFDEFJAIL_H_
# define _V_IFDEFJAIL_H_
# ifdef __GNUC__
# define STIN static __inline__
Oct 6, 2019
Oct 6, 2019
32
# elif defined(_WIN32)
33
# define STIN static __inline
Oct 6, 2019
Oct 6, 2019
34
35
# else
# define STIN static
36
37
38
39
40
41
42
# endif
#endif
#ifdef _WIN32
# include <malloc.h>
#endif
Oct 6, 2019
Oct 6, 2019
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#if defined HAVE_ALLOCA
# ifdef _WIN32
# include <malloc.h>
# define VAR_STACK(type, var, size) type *var = ((type*)_alloca(sizeof(type)*(size)))
# else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# include <stdlib.h>
# endif
# define VAR_STACK(type, var, size) type *var = ((type*) alloca(sizeof(type)*(size)))
# endif
#elif defined VAR_ARRAYS
# define VAR_STACK(type, var, size) type var[size]
#else
#error "Either VAR_ARRAYS or HAVE_ALLOCA must be defined to select the stack allocation mode"
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#endif
#ifdef USE_MEMORY_H
# include <memory.h>
#endif
#ifndef min
# define min(x,y) ((x)>(y)?(y):(x))
#endif
#ifndef max
# define max(x,y) ((x)<(y)?(y):(x))
#endif
#endif /* _OS_H */