2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef POSIX_ERROR_MAPPER_H
6 #define POSIX_ERROR_MAPPER_H
14 #define GET_REAL_FUNCTION(returnValue, function, parameters) \
15 static returnValue (*sReal_##function)parameters \
16 = (returnValue (*)parameters)dlsym(RTLD_DEFAULT, #function)
18 #define HIDDEN_FUNCTION(function) asm volatile(".hidden " #function)
20 #define WRAPPER_FUNCTION(returnValue, function, parameters, body) \
21 returnValue function parameters \
23 HIDDEN_FUNCTION(function); \
24 GET_REAL_FUNCTION(returnValue, function, parameters); \
28 #endif // POSIX_ERROR_MAPPER_H