X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcfg%2Fos.h;h=92f20d914d06a21bd6a831b6cd4c919d3d810aeb;hb=e62ca0b357f09804d7d894949df44224c9d74bb7;hp=cc1ebe696989011005908e04b0c13de6ef9ca2a6;hpb=3e2d80120922e13d77e2497290f96a3f0ed08488;p=bertos.git diff --git a/bertos/cfg/os.h b/bertos/cfg/os.h index cc1ebe69..92f20d91 100644 --- a/bertos/cfg/os.h +++ b/bertos/cfg/os.h @@ -27,22 +27,17 @@ * the GNU General Public License. * * Copyright 2004, 2005 Develer S.r.l. (http://www.develer.com/) - * + * Copyright 2008 Bernie Innocenti * --> * * \brief OS-specific definitions * * \version $Id$ - * * \author Bernie Innocenti */ -#ifndef DEVLIB_OS_H -#define DEVLIB_OS_H - -/** Macro to include OS-specific versions of the headers. */ -#define OS_HEADER(module) PP_STRINGIZE(emul/PP_CAT3(module, _, OS_ID).h) -#define OS_CSOURCE(module) PP_STRINGIZE(emul/PP_CAT3(module, _, OS_ID).c) +#ifndef CFG_OS_H +#define CFG_OS_H /* * OS autodetection (Some systems trigger multiple OS definitions) @@ -52,7 +47,7 @@ #define OS_ID win32 // FIXME: Maybe disable Win32 exceptions? - typedef int cpuflags_t; + typedef int cpu_flags_t; #define IRQ_DISABLE FIXME #define IRQ_ENABLE FIXME #define IRQ_SAVE_DISABLE(old_sigs) FIXME @@ -71,7 +66,7 @@ * The POSIX moral equivalent of disabling IRQs is disabling signals. */ #include - typedef sigset_t cpuflags_t; + typedef sigset_t cpu_flags_t; #define SET_ALL_SIGNALS(sigs) \ do { \ @@ -131,6 +126,9 @@ #define OS_DARWIN 0 #endif + +#include /* For ARCH_QT */ + /* * We want Qt and other frameworks to look like OSes because you would * tipically want their portable abstractions if you're using one of these. @@ -169,4 +167,18 @@ #error Neither hosted nor embedded OS environment #endif -#endif /* DEVLIB_OS_H */ +#if OS_HOSTED + + /// Macro to include OS-specific headers. + #define OS_HEADER(module) PP_STRINGIZE(emul/PP_CAT3(module, _, OS_ID).h) + + /// Macro to include OS-specific source files. + #define OS_CSOURCE(module) PP_STRINGIZE(emul/PP_CAT3(module, _, OS_ID).c) + +#else + // Fallbacks for embedded systems + #define OS_HEADER(module) CPU_HEADER(module) + #define OS_CSOURCE(module) CPU_CSOURCE(module) +#endif + +#endif /* CFG_OS_H */