libk  Diff

Differences From Artifact [9c53671363]:

To Artifact [694c1d32cc]:


     1         ---- kcore/def.h.m → <k/def.h>
     2         ---- ~ lexi hale <lexi@hale.su>
     3         ---- this file gathers information on the environment it's
     4         ---- being compiled in, setting macros that other headers
     5         ---- need. it will be emitted as <k/def.h>.
     6         ---- vim: ft=c
            1  +dnl kcore/def.h.m → <k/def.h>
            2  +dnl ~ lexi hale <lexi@hale.su>
            3  +dnl this file gathers information on the environment it's
            4  +dnl being compiled in, setting macros that other headers
            5  +dnl need. it will be emitted as <k/def.h>.
            6  +dnl vim: ft=c
     7      7   #ifndef KIdef
     8      8   #define KIdef
            9  +define(`def',`#define $1 $2')
           10  +
           11  +ifdef(`atom_target_bits',`
           12  +	define(`target',`atom_target_arch.atom_target_os.atom_target_bits')
           13  +	def(KVbits,atom_target_bits)',`
           14  +	define(`target',atom_target_arch.atom_target_os)')
           15  +
           16  +def(KVtarget,target)
           17  +def(KVos,atom_target_os)
           18  +def(KVarch,atom_target_arch)
     9     19   
    10         -[ifdef atom_target_bits]
    11         -	[define target: [atom_target_arch].[atom_target_os].[atom_target_bits]]
    12         -	#define KVbits [atom_target_bits]
    13         -[else]
    14         -	[define target: [atom_target_arch].[atom_target_os]]
    15         -[endif]
    16         -#define KVtarget [target]
    17         -#define KVos [atom_target_os]
    18         -#define KVarch [atom_target_arch]
    19         -[if [target_unix] == yes]
    20         -	#define KFenv_unix
    21         -	#define KFenv_posix
    22         -[else]
    23         -	[if [target_posix] == yes]
    24         -		#define KFenv_posix
    25         -	[endif]
    26         -[endif]
           20  +ifelse(target_unix,`yes',
           21  +		`def(`KFenv_unix',)
           22  +		def(`KFenv_posix',)',`
           23  +		ifelse(target_posix,`yes',
           24  +			`def(KFenv_posix)')')
    27     25   
    28     26   #define Kpragma(p) _Pragma(#p)
    29     27   #if defined(__GNUC__) || defined(__clang__)
    30     28   #   define Kerror(msg) Kpragma(GCC error #msg) 
    31     29   #else
    32     30   #   define Kerror(msg) Kpragma(message #msg)
    33     31   #endif
    34     32   #define Knoimpl(fn) Kerror(no implementation of fn for platform [target])
    35     33   
    36     34   #endif