Clean DEBUG macro

Change-Id: I5acf266d565045468c6fba19b1ca493773ae78bc
This commit is contained in:
Émilie Feral
2017-06-16 15:08:14 +02:00
parent 51437f0b4f
commit e37f1418e5
6 changed files with 6 additions and 9 deletions

View File

@@ -24,10 +24,6 @@ SFLAGS += -Wall
# Flags - Header dependency tracking
SFLAGS += -MD -MP
ifeq ($(DEBUG),1)
SFLAGS += -DDEBUG=1
endif
# Language-specific flags
CFLAGS = -std=c99
CXXFLAGS = -std=c++11 -fno-exceptions -fno-rtti -fno-threadsafe-statics

View File

@@ -2,7 +2,7 @@
PLATFORM ?= device
VERBOSE ?= 0
DEBUG ?= 1
DEBUG ?= 0
# Do not edit below this
@@ -18,5 +18,6 @@ include build/toolchain.$(TOOLCHAIN).mak
OS_WITH_ONBOARDING_APP ?= 1
OS_WITH_SOFTWARE_UPDATE_PROMPT ?= 1
SFLAGS += -DDEBUG=$(DEBUG)
SFLAGS += -DOS_WITH_ONBOARDING_APP=$(OS_WITH_ONBOARDING_APP)
SFLAGS += -DOS_WITH_SOFTWARE_UPDATE_PROMPT=$(OS_WITH_SOFTWARE_UPDATE_PROMPT)

View File

@@ -15,7 +15,7 @@ public:
static constexpr Event Special(int i) { return Event(4*PageSize+i); }
constexpr Event(int i) : m_id(i){} // TODO: Assert here that i>=0 && i<255
#ifdef DEBUG
#if DEBUG
uint8_t id() const { return m_id; }
const char * name() const;
#endif

View File

@@ -20,7 +20,7 @@ extern "C" {
}
void abort() {
#ifdef DEBUG
#if DEBUG
while (1) {
}
#else

View File

@@ -130,7 +130,7 @@ bool Event::isDefined() const {
}
}
#ifdef DEBUG
#if DEBUG
static constexpr const char * s_nameForEvent[255] = {
// Plain

View File

@@ -3,7 +3,7 @@
#include "private/macros.h"
#ifdef DEBUG
#if DEBUG
#define assert(e) ((void) ((e) ? ((void)0) : __assert(#e, __FILE__, __LINE__)))
#else
#define assert(e) ((void)0)