btstack_debug.h (bdbfbe1cea3693837842f50bc8c6a007309b4dc5) | btstack_debug.h (ad2dfd72d78c5390c29defdc79b9e60a7429cd11) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 58 unchanged lines hidden (view full) --- 67#ifndef BTSTACK_FILE__ 68#define BTSTACK_FILE__ __FILE__ 69#endif 70 71#ifdef HAVE_ASSERT 72// allow to override btstack_assert in btstack_config.h 73#ifndef btstack_assert 74// map to libc assert | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 58 unchanged lines hidden (view full) --- 67#ifndef BTSTACK_FILE__ 68#define BTSTACK_FILE__ __FILE__ 69#endif 70 71#ifdef HAVE_ASSERT 72// allow to override btstack_assert in btstack_config.h 73#ifndef btstack_assert 74// map to libc assert |
75#ifdef NDEBUG 76#define btstack_assert(condition) {(void)(condition);} 77#else |
|
75#define btstack_assert(condition) assert(condition) | 78#define btstack_assert(condition) assert(condition) |
79#endif |
|
76#endif /* btstack_assert */ 77#else /* HAVE_ASSERT */ 78#ifdef ENABLE_BTSTACK_ASSERT 79#include <stdnoreturn.h> 80noreturn void btstack_assert_failed(const char * file, uint16_t line_nr); 81#ifndef btstack_assert 82// use btstack macro that calls btstack_assert_failed() - provided by port 83#define btstack_assert(condition) if (condition) {} else { btstack_assert_failed(BTSTACK_FILE__, __LINE__); } --- 117 unchanged lines hidden --- | 80#endif /* btstack_assert */ 81#else /* HAVE_ASSERT */ 82#ifdef ENABLE_BTSTACK_ASSERT 83#include <stdnoreturn.h> 84noreturn void btstack_assert_failed(const char * file, uint16_t line_nr); 85#ifndef btstack_assert 86// use btstack macro that calls btstack_assert_failed() - provided by port 87#define btstack_assert(condition) if (condition) {} else { btstack_assert_failed(BTSTACK_FILE__, __LINE__); } --- 117 unchanged lines hidden --- |