From 36743f1df2a4fa3839d6af0204330915af563e6b Mon Sep 17 00:00:00 2001 From: bernie Date: Mon, 18 Aug 2008 16:53:34 +0000 Subject: [PATCH] OS_HEADER(), OS_CSOURCE(): Fall back to CPU_HEADER(), CPU_CSOURCE() git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1660 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/os.h | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/bertos/cfg/os.h b/bertos/cfg/os.h index 41a1ef7a..7fe97129 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) @@ -172,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 */ -- 2.25.1