PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
propgcc
propeller-elf
include
compiler.h
Go to the documentation of this file.
1
17
#ifndef _COMPILER_H
18
#define _COMPILER_H
19
20
#if defined(__GNUC__)
21
#define _INT_SIZE __SIZEOF_INT__
22
#define _LONG_SIZE __SIZEOF_LONG__
23
#define _WCHAR_SIZE __SIZEOF_WCHAR_T__
24
#ifdef __CHAR_UNSIGNED__
25
#define _CHAR_IS_UNSIGNED 1
26
#else
27
#define _CHAR_IS_UNSIGNED 0
28
#endif
29
#define _NORETURN __attribute__((noreturn))
30
#define _CONST __attribute__((const))
31
#define _WEAK __attribute__((weak))
32
33
#ifndef _WCHAR_T_TYPE
34
#define _WCHAR_T_TYPE __WCHAR_TYPE__
35
#endif
36
#define _CONSTRUCTOR __attribute__((constructor))
37
#define _DESTRUCTOR __attribute__((destructor))
38
#ifdef __PROPELLER_CMM__
39
#define _CACHED __attribute__((fcache))
40
#else
41
#define _CACHED
42
#endif
43
44
#define _NAN __builtin_nan("1")
45
#define _NANL __builtin_nanl("1")
46
#define _NANF __builtin_nanf("1")
47
48
/*
49
* __weak_alias creates a weak alias for a symbol
50
* for example, if you have a function "myprintf" and
51
* you want it to provide the "printf" function unless
52
* somebody explicitly defines printf elsewhere, you would
53
* do __weak_alias(printf, myprintf)
54
*/
55
#ifndef __weak_alias
56
#define __weak_alias(sym, oldfunc) \
57
__asm__( " .weak _" #sym "\n .equ _" #sym ",_" #oldfunc "\n" )
58
#endif
59
60
/*
61
* create a strong alias for a symbol
62
*/
63
#ifndef __strong_alias
64
#define __strong_alias(sym, oldfunc) \
65
__asm__( " .global _" #sym "\n .equ _" #sym ",_" #oldfunc "\n" )
66
#endif
67
68
/*
69
* create a reference for a symbol
70
*/
71
#ifndef __reference
72
#define __reference(sym) \
73
__asm__( " .global _" #sym "\n" )
74
#endif
75
76
#else
77
78
#error "compiler not yet supported"
79
80
#endif
81
82
83
#endif
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17