diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-24 15:39:58 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-24 15:39:58 -0800 |
commit | 1034ea7e8532da25cceb292469e8d90b6041ffab (patch) | |
tree | 5752b9e5b776450499b75e9afe0ccc550a9564a9 /lib.h | |
parent | c9589217a057869582aa6a5ec1dbd048a525455e (diff) | |
download | txr-1034ea7e8532da25cceb292469e8d90b6041ffab.tar.gz txr-1034ea7e8532da25cceb292469e8d90b6041ffab.tar.bz2 txr-1034ea7e8532da25cceb292469e8d90b6041ffab.zip |
Auto-detect what specifiers to use for inline functions.
Allow compiler command to be set independently of full path
for easier compiler switching.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -163,28 +163,28 @@ union obj { struct cobj co; }; -inline cnum tag(val obj) { return ((cnum) obj) & TAG_MASK; } -inline int is_ptr(val obj) { return obj && tag(obj) == TAG_PTR; } -inline int is_num(val obj) { return tag(obj) == TAG_NUM; } -inline int is_chr(val obj) { return tag(obj) == TAG_CHR; } -inline int is_lit(val obj) { return tag(obj) == TAG_LIT; } +INLINE cnum tag(val obj) { return ((cnum) obj) & TAG_MASK; } +INLINE int is_ptr(val obj) { return obj && tag(obj) == TAG_PTR; } +INLINE int is_num(val obj) { return tag(obj) == TAG_NUM; } +INLINE int is_chr(val obj) { return tag(obj) == TAG_CHR; } +INLINE int is_lit(val obj) { return tag(obj) == TAG_LIT; } -inline type_t type(val obj) +INLINE type_t type(val obj) { return tag(obj) ? (type_t) tag(obj) : obj->t.type; } -inline val auto_str(const wchar_t *str) +INLINE val auto_str(const wchar_t *str) { return (val) ((cnum) (str) | TAG_LIT); } -inline val static_str(const wchar_t *str) +INLINE val static_str(const wchar_t *str) { return (val) ((cnum) (str) | TAG_LIT); } -inline wchar_t *litptr(val obj) +INLINE wchar_t *litptr(val obj) { return (wchar_t *) ((cnum) obj & ~TAG_MASK); } |