2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-26 11:51:20 +01:00
waf/playground/embedded_resources/x-resources.h
2014-04-24 00:53:36 -04:00

35 lines
931 B
C

#ifndef X_RESOURCES_H
#define X_RESOURCES_H
#ifdef __APPLE__
#include <mach-o/getsect.h>
#define EXTLD(NAME) \
extern const unsigned char _section$__DATA__ ## NAME [];
#define LDVAR(NAME) _section$__DATA__ ## NAME
#define LDLEN(NAME) (getsectbyname("__DATA", "__" #NAME)->size)
#elif (defined __WIN32__) /* mingw */
#define EXTLD(NAME) \
extern const unsigned char binary_ ## NAME ## _start[]; \
extern const unsigned char binary_ ## NAME ## _end[];
#define LDVAR(NAME) \
binary_ ## NAME ## _start
#define LDLEN(NAME) \
((binary_ ## NAME ## _end) - (binary_ ## NAME ## _start))
#else /* gnu/linux ld */
#define EXTLD(NAME) \
extern const unsigned char _binary_ ## NAME ## _start[]; \
extern const unsigned char _binary_ ## NAME ## _end[];
#define LDVAR(NAME) \
_binary_ ## NAME ## _start
#define LDLEN(NAME) \
((_binary_ ## NAME ## _end) - (_binary_ ## NAME ## _start))
#endif
#endif /* X_RESOURCES_H */