Open Broadcaster Software
Free, open source software for live streaming and recording
c99defs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Hugh Bailey <obs.jim@gmail.com>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #pragma once
18 
19 /*
20  * Contains hacks for getting some C99 stuff working in VC, things like
21  * bool, inline, stdint
22  */
23 
24 #define UNUSED_PARAMETER(param) (void)param
25 
26 #ifdef _MSC_VER
27 #define DEPRECATED __declspec(deprecated)
28 #define FORCE_INLINE __forceinline
29 #else
30 #define DEPRECATED __attribute__ ((deprecated))
31 #define FORCE_INLINE inline __attribute__((always_inline))
32 #endif
33 
34 #ifdef _MSC_VER
35 
36 /* Microsoft is one of the most inept companies on the face of the planet.
37  * The fact that even visual studio 2013 doesn't support the standard 'inline'
38  * keyword is so incredibly stupid that I just can't imagine what sort of
39  * incredibly inept moron could possibly be managing the visual C compiler
40  * project. They should be fired, and legally forbidden to have a job in
41  * ANYTHING even REMOTELY related to programming. FOREVER. This should also
42  * apply to the next 10 generations all of their descendents. */
43 #ifndef __cplusplus
44 #define inline __inline
45 #endif
46 
47 #define EXPORT __declspec(dllexport)
48 #else
49 #define EXPORT
50 #endif
51 
52 #if _MSC_VER && _MSC_VER < 0x0708
53 
54 #include "vc/vc_stdint.h"
55 #include "vc/vc_stdbool.h"
56 
57 #ifndef __off_t_defined
58 #define __off_t_defined
59 #if _FILE_OFFSET_BITS == 64
60 typedef long long off_t;
61 #else
62 typedef long off_t;
63 #endif
64 typedef int64_t off64_t;
65 #endif /* __off_t_defined */
66 
67 #define SIZE_T_FORMAT "%u"
68 
69 #else
70 
71 #include <stddef.h>
72 #include <stdint.h>
73 #include <stdbool.h>
74 #include <sys/types.h>
75 
76 #define SIZE_T_FORMAT "%zu"
77 
78 #endif /* _MSC_VER */
__int64 int64_t
Definition: vc_stdint.h:32