4 * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See devlib/README for information.
8 * \brief OS-specific definitions
12 * \author Bernardo Innocenti <bernie@develer.com>
17 *#* Revision 1.1 2004/12/31 17:40:24 bernie
18 *#* Add OS detection code.
25 /*! Macro to include OS-specific versions of the headers. */
26 #define OS_HEADER(module) PP_STRINGIZE(PP_CAT3(module, _, OS_ID).h)
29 * OS autodetection (Some systems trigger multiple OS definitions)
40 #define OS_POSIX 1 /* Not strictly UNIX, but no way to autodetect it. */
53 #if defined(__APPLE__) && defined(__MACH__)
60 * Summarize hosted environments as OS_HOSTED.
62 #if OS_WIN32 || OS_UNIX
69 * Summarize embedded environments as OS_EMBEDDED.
71 #if CPU_AVR || CPU_DSP56K || CPU_I196 || defined(__embedded__)
78 /* Self-check for the detection */
79 #if CPU_I196 + CPU_X86 + CPU_DSP56K + CPU_AVR == 0
83 #error OS_ID not defined
85 #if OS_HOSTED && OS_EMBEDDED
86 #error Both hosted and embedded OS environment
88 #if !OS_HOSTED && !OS_EMBEDDED
89 #error Neither hosted nor embedded OS environment
92 #endif /* DEVLIB_OS_H */