libk  Diff

Differences From Artifact [694c1d32cc]:

To Artifact [2981fff8c9]:


1
2
3
4
5
6
7
8

9



10
11
12
13
14
15
16
17














18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
dnl kcore/def.h.m → <k/def.h>
dnl ~ lexi hale <lexi@hale.su>
dnl this file gathers information on the environment it's
dnl being compiled in, setting macros that other headers
dnl need. it will be emitted as <k/def.h>.
dnl vim: ft=c
#ifndef KIdef
#define KIdef

define(`def',`#define $1 $2')




ifdef(`atom_target_bits',`
	define(`target',`atom_target_arch.atom_target_os.atom_target_bits')
	def(KVbits,atom_target_bits)',`
	define(`target',atom_target_arch.atom_target_os)')

def(KVtarget,target)
def(KVos,atom_target_os)














def(KVarch,atom_target_arch)


ifelse(target_unix,`yes',
		`def(`KFenv_unix',)
		def(`KFenv_posix',)',`
		ifelse(target_posix,`yes',
			`def(KFenv_posix)')')

#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





|


>
|
>
>
>






|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>













|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
dnl kcore/def.h.m → <k/def.h>
dnl ~ lexi hale <lexi@hale.su>
dnl this file gathers information on the environment it's
dnl being compiled in, setting macros that other headers
dnl need. it will be emitted as <k/def.h>.
dnl vim: ft=m4
#ifndef KIdef
#define KIdef
define(`_atom',0)dnl
define(`def',`#define $1 $2')dnl
define(`defatom',`def($1,$2$3)')dnl
define(`newatom',`def($1,_atom)
	define(`_atom',incr(_atom))')dnl

ifdef(`atom_target_bits',`
	define(`target',`atom_target_arch.atom_target_os.atom_target_bits')
	def(KVbits,atom_target_bits)',`
	define(`target',atom_target_arch.atom_target_os)')

newatom(KA_os_lin)dnl
newatom(KA_os_fbsd)dnl
newatom(KA_os_obsd)dnl
newatom(KA_os_nbsd)dnl
newatom(KA_os_dar)dnl
newatom(KA_os_osx)dnl
newatom(KA_os_and)dnl
newatom(KA_os_hai)dnl
newatom(KA_os_win)dnl

newatom(KA_arch_x86)dnl
newatom(KA_arch_arm)dnl
newatom(KA_arch_ppc)dnl
newatom(KA_arch_mips)dnl
newatom(KA_arch_itan)dnl

defatom(KVos,KA_os_,atom_target_os)
defatom(KVarch,KA_arch_,atom_target_arch)

ifelse(target_unix,`yes',
		`def(`KFenv_unix',)
		def(`KFenv_posix',)',`
		ifelse(target_posix,`yes',
			`def(KFenv_posix)')')

#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
def(`Knoimpl(fn)', Kerror(no implementation of fn for platform target))

#endif