libk  def.h.m at [14172a910a]

File legacy/kcore/def.h.m artifact 9c53671363 part of check-in 14172a910a


--- kcore/def.h.m → <k/def.h>
--- ~ lexi hale <lexi@hale.su>
--- this file gathers information on the environment it's
--- being compiled in, setting macros that other headers
--- need. it will be emitted as <k/def.h>.
--- vim: ft=c
#ifndef KIdef
#define KIdef

[ifdef atom_target_bits]
	[define target: [atom_target_arch].[atom_target_os].[atom_target_bits]]
	#define KVbits [atom_target_bits]
[else]
	[define target: [atom_target_arch].[atom_target_os]]
[endif]
#define KVtarget [target]
#define KVos [atom_target_os]
#define KVarch [atom_target_arch]
[if [target_unix] == yes]
	#define KFenv_unix
	#define KFenv_posix
[else]
	[if [target_posix] == yes]
		#define KFenv_posix
	[endif]
[endif]

#define Kpragma(p) _Pragma(#p)
#if defined(__GNUC__) || defined(__clang__)
#   define Kerror(msg) Kpragma(GCC error #msg) 
#else
#   define Kerror(msg) Kpragma(message #msg)
#endif
#define Knoimpl(fn) Kerror(no implementation of fn for platform [target])

#endif