libk  def.h at [b590aba21d]

File legacy/kcore/def.h artifact 074eb1cc6b part of check-in b590aba21d


#include <k/type.h>
/* <k/def.h>
 * ~ lexi hale <lexi@hale.su>
 * define flags so we can reason about
 * our environment. */

#if (KVos == lin)  ||\
    (KVos == fbsd) ||\
    (KVos == obsd) ||\
    (KVos == nbsd) ||\
    (KVos == dar) ||\
    (KVos == and)  
#   define KFenv_unix
#endif

#if defined(KFenv_unix)  ||\
           (KVos == hai) ||\
           (KVos == mgw)
#   define KFenv_posix
#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,p) Kerror(no implementation of fn for platform p)