DragonFlyBSD Kernel Audit
DF-0265 / kshim.h
← back to finding ↓ download raw
/* kshim.h -- userspace shims so the EXACT, UNMODIFIED sys/net/zlib.c
 * (which is written for _KERNEL compilation) also builds in userspace.
 * Injected via `cc -include kshim.h`. We do NOT edit zlib.c; this header
 * only supplies the few kernel-only tokens zlib.c references at file scope
 * (the trailing MODULE_VERSION module-macro and the MAX macro from
 * <sys/param.h>). None of these touch the inflate distance-handling code
 * under test. */
#ifndef DF0265_KSHIM_H
#define DF0265_KSHIM_H

#ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif

/* kernel module-macros -> no-ops in userspace */
#define MODULE_VERSION(name, ver)
#define MODULE_DEPEND(name, mod, vmaj, vmin, vpatch)
#define MODULE_DECL(name)
#define DECLARE_MODULE(name, data, sub, order)

#endif