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 2005/04/11 19:04:13 bernie
18 *#* Move top-level headers to cfg/ subdir.
20 *#* Revision 1.1 2004/12/31 17:40:24 bernie
21 *#* Add OS detection code.
28 /*! Macro to include OS-specific versions of the headers. */
29 #define OS_HEADER(module) PP_STRINGIZE(PP_CAT3(module, _, OS_ID).h)
32 * OS autodetection (Some systems trigger multiple OS definitions)
43 #define OS_POSIX 1 /* Not strictly UNIX, but no way to autodetect it. */
56 #if defined(__APPLE__) && defined(__MACH__)
63 * Summarize hosted environments as OS_HOSTED.
65 #if OS_WIN32 || OS_UNIX
72 * Summarize embedded environments as OS_EMBEDDED.
74 #if CPU_AVR || CPU_DSP56K || CPU_I196 || defined(__embedded__)
81 /* Self-check for the detection */
82 #if CPU_I196 + CPU_X86 + CPU_DSP56K + CPU_AVR == 0
86 #error OS_ID not defined
88 #if OS_HOSTED && OS_EMBEDDED
89 #error Both hosted and embedded OS environment
91 #if !OS_HOSTED && !OS_EMBEDDED
92 #error Neither hosted nor embedded OS environment
95 #endif /* DEVLIB_OS_H */