mirror of
https://github.com/ModOrganizer2/udis86.git
synced 2026-07-27 14:05:57 -07:00
Simplify standalone header include contract
(Issue #62) In __UD_STANDALONE__ mode, the onus is now on the client to make sure that the right set of files are included prior to including udis86.h in their environment. types.h no longer assumes the availability of header files. I haven't tried this myself in a kernel build environment, but I'm hoping someone will, and get back with problems if any.
This commit is contained in:
+8
-14
@@ -27,28 +27,22 @@
|
||||
#define UD_TYPES_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/* -D__KERNEL__ is automatically passed on the command line when
|
||||
building something as part of the Linux kernel */
|
||||
/*
|
||||
* -D__KERNEL__ is automatically passed on the command line when
|
||||
* building something as part of the Linux kernel. Assume standalone
|
||||
* mode.
|
||||
*/
|
||||
# include <linux/kernel.h>
|
||||
# include <linux/string.h>
|
||||
# ifndef __UD_STANDALONE__
|
||||
# define __UD_STANDALONE__ 1
|
||||
#endif
|
||||
# endif
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#if !defined(__UD_STANDALONE__)
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
# define inline __inline /* MS Visual Studio requires __inline
|
||||
instead of inline for C code */
|
||||
#elif !defined(__UD_STANDALONE__)
|
||||
# include <stdio.h>
|
||||
# include <inttypes.h>
|
||||
#else /* !__UD_STANDALONE__ */
|
||||
# include <inttypes.h>
|
||||
# include <stddef.h>
|
||||
# include <stdarg.h>
|
||||
#endif /* __UD_STANDALONE__ */
|
||||
#endif
|
||||
|
||||
/* gcc specific extensions */
|
||||
#ifdef __GNUC__
|
||||
|
||||
Reference in New Issue
Block a user