forked from FluidSynth/fluidsynth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfluid_stub_functions.h
More file actions
67 lines (56 loc) · 1.8 KB
/
Copy pathfluid_stub_functions.h
File metadata and controls
67 lines (56 loc) · 1.8 KB
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
/* FluidSynth - A Software Synthesizer
*
* Copyright (C) 2003 Peter Hanappe and others.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see
* <https://www.gnu.org/licenses/>.
*/
/*
* @file fluid_stub_functions.h
*
* This header provides macros to create inline stub functions.
*/
#ifndef _FLUID_STUB_FUNCTIONS_H
#define _FLUID_STUB_FUNCTIONS_H
#include "fluidsynth_priv.h"
#ifdef NDEBUG
#define STUB_FUNCTION_LOG_LEVEL FLUID_DBG
#else
#define STUB_FUNCTION_LOG_LEVEL FLUID_ERR
#endif
#define STUB_FUNCTION_VOID(function, args) \
static FLUID_INLINE void \
function args \
{ \
FLUID_LOG(STUB_FUNCTION_LOG_LEVEL, "function " # function " is a stub"); \
}
#define STUB_FUNCTION(function, type, result, args) \
static FLUID_INLINE type \
function args \
{ \
FLUID_LOG(STUB_FUNCTION_LOG_LEVEL, "function " # function " is a stub, always returning " # result); \
return result; \
}
#define STUB_FUNCTION_VOID_SILENT(function, args) \
static FLUID_INLINE void \
function args \
{ \
}
#define STUB_FUNCTION_SILENT(function, type, result, args) \
static FLUID_INLINE type \
function args \
{ \
return result; \
}
#endif /* _FLUID_STUB_FUNCTIONS_H */