mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.gen.c: add a __V_architecture macro
This commit is contained in:
parent
0e34ce2759
commit
6e9218c088
@ -61,11 +61,17 @@ const c_common_macros = '
|
||||
#define __NOINLINE __attribute__((noinline))
|
||||
#define __IRQHANDLER __attribute__((interrupt))
|
||||
|
||||
#define __V_architecture 0
|
||||
#if defined(__x86_64__)
|
||||
#define __V_amd64 1
|
||||
#undef __V_architecture
|
||||
#define __V_architecture 1
|
||||
#endif
|
||||
|
||||
#if defined(__aarch64__) || defined(__arm64__)
|
||||
#define __V_arm64 1
|
||||
#undef __V_architecture
|
||||
#define __V_architecture 2
|
||||
#endif
|
||||
|
||||
// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:
|
||||
|
Loading…
Reference in New Issue
Block a user