diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-10-31 12:37:33 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-10-31 12:37:33 +0300 |
commit | c0b1908a673e62e8553264f31057843d11a27bc5 (patch) | |
tree | b83657765ee39d6317c2a1420d0cafd1cd4550a2 | |
parent | 1f1c2b39cd57d8d9782685c595b005d6b7023c46 (diff) |
Replaced ecv.h by ecv_duet3d.h with standard undefs for C++
Also other minor changes to facilitate static analysis
-rw-r--r-- | .cproject | 11 | ||||
-rw-r--r-- | src/GCodes/GCodes3.cpp | 6 | ||||
-rw-r--r-- | src/Hardware/SAM4E/PinDescription.h | 22 | ||||
-rw-r--r-- | src/Hardware/SAME70/Ethernet/ksz8081rna/ethernet_phy.h | 8 | ||||
-rw-r--r-- | src/Libraries/Fatfs/diskio.cpp | 4 | ||||
-rw-r--r-- | src/Networking/LwipEthernet/Lwip/lwipopts.h | 4 | ||||
-rw-r--r-- | src/Platform/MessageType.h | 44 | ||||
-rw-r--r-- | src/RepRapFirmware.h | 18 | ||||
-rw-r--r-- | src/ecv.h | 219 |
9 files changed, 53 insertions, 283 deletions
@@ -53,6 +53,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/header_files}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/cmsis/sam4e/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/arm/CMSIS/5.4.0/CMSIS/Core/Include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1227675538" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAM4E8E__"/> @@ -213,6 +214,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/header_files}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/cmsis/sam4s/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/arm/CMSIS/5.4.0/CMSIS/Core/Include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.833298868" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAM4S8C__"/> @@ -371,6 +373,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/header_files}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/cmsis/sam4s/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/arm/CMSIS/5.4.0/CMSIS/Core/Include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1626366618" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAM4S8C__"/> @@ -532,6 +535,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/SAME70}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip/src/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1985229414" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAME70Q20B__"/> @@ -691,6 +695,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/SAME70}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip/src/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1332495733" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAME70Q20B__"/> @@ -853,6 +858,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/header_files}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/cmsis/sam4e/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/arm/CMSIS/5.4.0/CMSIS/Core/Include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1590962224" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAM4E8E__"/> @@ -1009,6 +1015,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip/src/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Hardware/SAME5x/Ethernet}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1307601575" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAME54P20A__"/> @@ -1154,7 +1161,6 @@ <option id="gnu.c.compiler.option.misc.other.1176394435" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="true" value="-c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -nostdlib -Wundef -Wdouble-promotion -Werror=return-type -Werror=implicit -fsingle-precision-constant "-Wa,-ahl=$*.s"" valueType="string"/> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.468883064" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src//SAME5x_C21/SAME5x}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/atmel/SAME54_DFP/1.1.134/include}""/> @@ -1162,6 +1168,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip/src/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Hardware/SAME5x/Ethernet}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.126387254" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAME54P20A__"/> @@ -1318,6 +1325,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip/src/include}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Hardware/SAME5x/Ethernet}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.582894620" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAME54P20A__"/> @@ -1488,6 +1496,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/SAME70}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/Networking/LwipEthernet/Lwip/src/include}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/RRFLibraries/src}""/> </option> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1384259539" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="__SAME70Q20B__"/> diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp index 4bb98433..b3910549 100644 --- a/src/GCodes/GCodes3.cpp +++ b/src/GCodes/GCodes3.cpp @@ -1350,10 +1350,10 @@ GCodeResult GCodes::ConfigureDriver(GCodeBuffer& gb, const StringRef& reply) THR reply.copy("["); } - // Hangprinter needs M569 to support multiple P parameters in M569.3. This poses a problem for other uses of M569 because the output may be too long + // Hangprinter needs M569 to support multiple P parameters in M569.3 and M569.4. This poses a problem for other uses of M569 because the output may be too long // to fit in the reply buffer, and we can only use an OutputBuffer instead if the overall result is success. - // Therefore we only support multiple P parameters for subfunction 3. - GCodeResult res; + // Therefore we only support multiple P parameters for subfunctions 3 and 4. + GCodeResult res = GCodeResult::ok; for (size_t i = 0; i < drivesCount; ++i) { DriverId const id = driverIds[i]; diff --git a/src/Hardware/SAM4E/PinDescription.h b/src/Hardware/SAM4E/PinDescription.h index d08e16de..85bfa0cc 100644 --- a/src/Hardware/SAM4E/PinDescription.h +++ b/src/Hardware/SAM4E/PinDescription.h @@ -15,19 +15,19 @@ enum class PinCapability: uint8_t { // Individual capabilities - none = 0, - read = 1, - ain = 2, - write = 4, - pwm = 8, + none = 0u, + read = 1u, + ain = 2u, + write = 4u, + pwm = 8u, // Combinations - ainr = 1|2, - rw = 1|4, - wpwm = 4|8, - rwpwm = 1|4|8, - ainrw = 1|2|4, - ainrwpwm = 1|2|4|8 + ainr = 1u|2u, + rw = 1u|4u, + wpwm = 4u|8u, + rwpwm = 1u|4u|8u, + ainrw = 1u|2u|4u, + ainrwpwm = 1u|2u|4u|8u }; constexpr inline PinCapability operator|(PinCapability a, PinCapability b) noexcept diff --git a/src/Hardware/SAME70/Ethernet/ksz8081rna/ethernet_phy.h b/src/Hardware/SAME70/Ethernet/ksz8081rna/ethernet_phy.h index e9b73122..85e93438 100644 --- a/src/Hardware/SAME70/Ethernet/ksz8081rna/ethernet_phy.h +++ b/src/Hardware/SAME70/Ethernet/ksz8081rna/ethernet_phy.h @@ -47,17 +47,13 @@ #ifndef ETHERNET_PHY_H_INCLUDED #define ETHERNET_PHY_H_INCLUDED -#include <ecv.h> -#undef array -#undef out - #include "compiler.h" // IEEE defined Registers #define GMII_BMCR 0x00 // Basic Control #define GMII_BMSR 0x01 // Basic Status -#define GMII_PHYID1 0x02 // PHY Idendifier 1 -#define GMII_PHYID2 0x03 // PHY Idendifier 2 +#define GMII_PHYID1 0x02 // PHY Identifier 1 +#define GMII_PHYID2 0x03 // PHY Identifier 2 #define GMII_ANAR 0x04 // Auto_Negotiation Advertisement #define GMII_ANLPAR 0x05 // Auto_negotiation Link Partner Ability #define GMII_ANER 0x06 // Auto-negotiation Expansion diff --git a/src/Libraries/Fatfs/diskio.cpp b/src/Libraries/Fatfs/diskio.cpp index d41a6193..3f5b5e0a 100644 --- a/src/Libraries/Fatfs/diskio.cpp +++ b/src/Libraries/Fatfs/diskio.cpp @@ -41,9 +41,7 @@ * */ -#include <ecv.h> -#undef array -#undef out +#include <ecv_duet3d.h> #include "compiler.h" #include "diskio.h" diff --git a/src/Networking/LwipEthernet/Lwip/lwipopts.h b/src/Networking/LwipEthernet/Lwip/lwipopts.h index eb382665..97de9635 100644 --- a/src/Networking/LwipEthernet/Lwip/lwipopts.h +++ b/src/Networking/LwipEthernet/Lwip/lwipopts.h @@ -42,9 +42,7 @@ #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ -#include <ecv.h> -#undef array -#undef out +#include <ecv_duet3d.h> /* Include ethernet configuration first */ #include "conf_eth.h" diff --git a/src/Platform/MessageType.h b/src/Platform/MessageType.h index 4823dbb7..7f82f0f2 100644 --- a/src/Platform/MessageType.h +++ b/src/Platform/MessageType.h @@ -15,34 +15,34 @@ enum MessageType : uint32_t { // Destinations (bytes 1-2) // Keep the following in sync with the order of GCodeBuffers in the GCodes class - HttpMessage = 0x01, // A message that is to be sent to the web (HTTP) - TelnetMessage = 0x02, // A message that is to be sent to a Telnet client - FileMessage = 0x04, // A message that is to be sent to a file processor - UsbMessage = 0x08, // A message that is to be sent in non-blocking mode to the host via USB - AuxMessage = 0x10, // A message that is to be sent to an auxiliary device (PanelDue) - TriggerMessage = 0x20, // A message that is to be sent to a trigger processor - CodeQueueMessage = 0x40, // A message that is to be sent to the code queue channel - LcdMessage = 0x80, // A message that is to be sent to the panel - SbcMessage = 0x100, // A message that is to be sent to the SBC - DaemonMessage = 0x200, // A message that is sent to the daemon processor - Aux2Message = 0x400, // A message that is to be sent to the second aux device - AutoPauseMessage = 0x800, // A message that is to be sent to an auto-pause processor + HttpMessage = 0x01u, // A message that is to be sent to the web (HTTP) + TelnetMessage = 0x02u, // A message that is to be sent to a Telnet client + FileMessage = 0x04u, // A message that is to be sent to a file processor + UsbMessage = 0x08u, // A message that is to be sent in non-blocking mode to the host via USB + AuxMessage = 0x10u, // A message that is to be sent to an auxiliary device (PanelDue) + TriggerMessage = 0x20u, // A message that is to be sent to a trigger processor + CodeQueueMessage = 0x40u, // A message that is to be sent to the code queue channel + LcdMessage = 0x80u, // A message that is to be sent to the panel + SbcMessage = 0x100u, // A message that is to be sent to the SBC + DaemonMessage = 0x200u, // A message that is sent to the daemon processor + Aux2Message = 0x400u, // A message that is to be sent to the second aux device + AutoPauseMessage = 0x800u, // A message that is to be sent to an auto-pause processor // Special destinations (byte 3) - BlockingUsbMessage = 0x10000, // A message that is to be sent to USB in blocking mode - ImmediateAuxMessage = 0x20000, // A message that is to be sent to LCD in immediate mode + BlockingUsbMessage = 0x10000u, // A message that is to be sent to USB in blocking mode + ImmediateAuxMessage = 0x20000u, // A message that is to be sent to LCD in immediate mode - DestinationsMask = 0x308FF, // Mask for all the destinations + DestinationsMask = 0x308FFu, // Mask for all the destinations // Special indicators (byte 4) // The first two are not processed when calling the version of Platform::Message that takes an OutputBuffer. - ErrorMessageFlag = 0x1000000, // This is an error message - WarningMessageFlag = 0x2000000, // This is a warning message - RawMessageFlag = 0x8000000, // Do not encapsulate this message - BinaryCodeReplyFlag = 0x10000000, // This message comes from a binary G-Code buffer - PushFlag = 0x20000000, // There is more to come; the message has been truncated - LogMessageLowBit = 0x40000000, // Log level consists of two bits this is the low bit - LogMessageHighBit = 0x80000000, // Log level consists of two bits this is the high bit + ErrorMessageFlag = 0x1000000u, // This is an error message + WarningMessageFlag = 0x2000000u, // This is a warning message + RawMessageFlag = 0x8000000u, // Do not encapsulate this message + BinaryCodeReplyFlag = 0x10000000u, // This message comes from a binary G-Code buffer + PushFlag = 0x20000000u, // There is more to come; the message has been truncated + LogMessageLowBit = 0x40000000u, // Log level consists of two bits this is the low bit + LogMessageHighBit = 0x80000000u, // Log level consists of two bits this is the high bit // Common combinations NoDestinationMessage = 0, // A message that is going nowhere diff --git a/src/RepRapFirmware.h b/src/RepRapFirmware.h index ef1420d6..0b8a0d25 100644 --- a/src/RepRapFirmware.h +++ b/src/RepRapFirmware.h @@ -22,6 +22,8 @@ Licence: GPL #ifndef REPRAPFIRMWARE_H #define REPRAPFIRMWARE_H +#include <ecv_duet3d.h> + #include <cstddef> // for size_t #include <cfloat> #include <cstdarg> @@ -32,20 +34,6 @@ Licence: GPL [[deprecated("use SafeStrptime instead")]] char * strptime (const char *buf, const char *format, struct tm *timeptr); const char *SafeStrptime(const char *buf, const char *format, struct tm *timeptr) noexcept; -#include "ecv.h" -#ifdef value -# undef value // needed because some files include include <optional> -#endif -#ifdef array -# undef array // needed because some files include <functional> -#endif -#ifdef assert -# undef assert -#endif -#ifdef result -# undef result -#endif - #include <Core.h> #ifndef SAMC21 @@ -79,7 +67,7 @@ constexpr unsigned int ApiLevel = 1; // Logical pins used for general output, servos, CCN and laser control typedef uint8_t LogicalPin; // type used to represent logical pin numbers constexpr LogicalPin NoLogicalPin = 0xFF; -constexpr const char *NoPinName = "nil"; +constexpr const char * _ecv_array NoPinName = "nil"; // Enumeration to describe what we want to do with a pin enum class PinAccess : int diff --git a/src/ecv.h b/src/ecv.h deleted file mode 100644 index f6193945..00000000 --- a/src/ecv.h +++ /dev/null @@ -1,219 +0,0 @@ -/* Header file for supporting Escher C Verifier annotations in C and C++ files - * Copyright(c) 2016 Escher Technologies Limited - * Escher Technologies Limited permits free use and distribution of this file for the purpose of annotating C and C++ programs - * in a manner compatible with Escher C Verifier, subject to the following conditions: - * 1. If you make any alterations to this file, you must make this clear by adding additional comments, - * and you must reproduce these conditions and copyright notice in full. - * 2. No warranty or support is provided except in accordance with the terms of a paid-up support & maintenance agreement - * between the user and Escher Technologies Limited. - * - * For documentation of the eCv keywords, see the eCv Reference Manual at http://eschertech.com/support/perfect_developer_self_help.php - * For examples of their use, see http://eschertech.com/articles/index.php - */ - -#if !defined(__ECV_H_INCLUDED__) - -#define __ECV_H_INCLUDED__ - -#ifdef __ECV__ -#pragma ECV noverify -#endif - -/* Define the "normal" versions of the eCv keywords. - * If any of these clash with identifiers in the user program, you can #undef them after including this file. */ - -#define any _ecv_any -#define array _ecv_array -#define assert _ecv_assert -#define assume _ecv_assume -#define decrease _ecv_decrease -#define disjoint _ecv_disjoint -#define exists _ecv_exists -#define forall _ecv_forall -#define ghost _ecv_ghost -#define holds _ecv_holds -#define idiv _ecv_idiv -#define imod _ecv_imod -#define in _ecv_in -#define integer _ecv_integer -#define invariant _ecv_invariant -#define keep _ecv_keep -#define let _ecv_let -#define maxof _ecv_maxof -#define minof _ecv_minof -#define min_sizeof _ecv_min_sizeof -#define not_null _ecv_not_null -#define null _ecv_null -#define old _ecv_old -#define out _ecv_out -#define over _ecv_over -#define post _ecv_post -#define pre _ecv_pre -#define result _ecv_result -#define returns _ecv_returns -#define some _ecv_some -#define spec _ecv_spec -#define that _ecv_that -#define those _ecv_those -#define value _ecv_value -#define writes _ecv_writes -#define yield _ecv_yield -#define zero_init _ecv_zero_init - -#if defined(__ECV__) || !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 19901L) -# define restrict _ecv_restrict -#endif - -#if defined(__cplusplus) -# define early _ecv_early -# define from _ecv_from -# if defined(__ECV__) || (__cplusplus < 201103L) -// The C++'11 final, nullptr and override keywords are available whenever processing C++ with eCv -# define final _ecv_final -# define nullptr _ecv_nullptr -# define override _ecv_override -# endif -#endif - -#if defined(__ECV__) - -/************************ The following definitions are only active when running eCv **********************/ - -#if defined(_MSC_VER) - -/******************** Definitions for Microsoft compilers *********************/ - -/* Define Microsoft compiler-specific keywords as expanding to nothing */ -#define __declspec(_x) -#define __w64 -#define __inline inline -#define __cdecl -#define __fastcall -#define __stdcall - -#if _MSC_VER >= 1400 - -/ * Microsoft file crtdefs.h (which is included by nearly everything else) contains some references to types not defined there. - * To avoid problems, we include crtdefs.h here along with the files that define the missing types. */ -#define __STDC_WANT_SECURE_LIB__ (0) /* need this to undo some inline declarations that don't compile in eCv */ -#define _CRT_SECURE_NO_WARNINGS (1) -#include "crtdefs.h" -#include "locale.h" /* defines "struct lconv" */ -struct __lc_time_data { int _x; }; /* this is defined only in the CRT source */ -struct threadmbcinfostruct { int _x; }; /* this is defined only in the CRT source */ -#endif - -#endif /* end Microsoft compiler specific */ - -#if defined(__GNUC__) - -/*********************** Definitions for Gnu Compiler Collection C and C++ compilers ********************/ - -#define __inline__ inline -#define __restrict__ _ecv_restrict -#define __restrict _ecv_restrict -#define __asm asm - -/* Hide gcc __attribute__ keyword from eCv. - * WARNING: some header files (e.g. _mingw.h) may "#undef __attribute__", which undoes this. */ -#define __attribute__(_x) - -/* The following are needed to handle gcc's implementation of variable argument lists */ -typedef struct __builtin_va_list__ { int x; } __builtin_va_list; -extern void __builtin_va_start(__builtin_va_list, const char*); -extern void __builtin_va_end(__builtin_va_list); - -#endif /* end gcc specific */ - -#if defined HI_TECH_C - -/****************************** Definitions for HiTech C compilers ********************************/ - -#define bit bool /* define HiTech bit type as equivalent to bool */ - -/* Define the HiTech C extra type qualifiers */ -#define interrupt _ecv_interrupt /* functions may be flagged as interrupt routines */ -#define persistent -#define near -#define bank0 -#define bank1 -#define bank2 -#define bank3 -#define eeprom -#define __interrupt _ecv_interrupt /* functions may be flagged as interrupt routines */ -#define __persistent -#define __near -#define __bank0 -#define __bank1 -#define __bank2 -#define __bank3 -#define __eeprom - -#define asm(_x) /* hide assembler from eCv */ - -#endif /* end HiTech compiler specific */ - -#if defined __IAR_SYSTEMS_ICC__ - -/****************************** Definitions for IAR C/C++ compilers ********************************/ - -/* Define the IAR extra keywords */ -#define __cc_version1 -#define __cc_version2 -#define __data16 -#define __data20 -#define __interrupt _ecv_interrupt /* functions may be flagged as interrupt routines */ -#define __intrinsic -#define __monitor -#define __no_init -#define __no_pic -#define __noreturn -#define __persistent -#define __ramfunc -#define __raw -#define __regvar -#define __root -#define __ro_placement -#define __save_reg20 -#define __task - -#endif /* end IAR compiler specific */ - -/**************************** End of compiler-specific definitions ***************************/ - -#else /* not running eCv */ - -/* Define eCv macros as expanding to nothing */ -#define _ecv_array -#define _ecv_assert(_x) ((void)0) -#define _ecv_assume(_x) -#define _ecv_change(_x) -#define _ecv_decrease(_x) -#define _ecv_ghost(_x) -#define _ecv_interrupt -#define _ecv_invariant(_x) -#define _ecv_keep(_x) -#define _ecv_not_null(_x) (_x) -#define _ecv_null -#define _ecv_out -#define _ecv_pass ((void)0) -#define _ecv_post(_x) -#define _ecv_pre(_x) -#define _ecv_restrict -#define _ecv_returns(_x) -#define _ecv_spec -#define _ecv_writes(_x) - -#if defined(__cplusplus) -#define _ecv_early -#define _ecv_final -#define _ecv_from -#define _ecv_nullptr (0) -#define _ecv_override -#endif - -#endif /* end "if defined(__ECV__) ... else ..." */ - -#endif /* end header guard */ - -/* End of file */ |