Commit e3743b5f authored by Davis King's avatar Davis King

Added a config.h file that can be used to permanently enable or disable

asserts when creating a shared library for dlib.
parent 6efc800b
......@@ -3,7 +3,7 @@
#ifndef DLIB_ASSERt_
#define DLIB_ASSERt_
#include "config.h"
#include <sstream>
#include <iosfwd>
#include "error.h"
......@@ -49,11 +49,14 @@ namespace dlib
// -----------------------------
#if defined DEBUG || defined _DEBUG
#if defined DLIB_DISABLE_ASSERTS
// if DLIB_DISABLE_ASSERTS is on then never enable DLIB_ASSERT no matter what.
#undef ENABLE_ASSERTS
#endif
#if !defined(DLIB_DISABLE_ASSERTS) && ( defined DEBUG || defined _DEBUG)
// make sure ENABLE_ASSERTS is defined if we are indeed using them.
#ifndef ENABLE_ASSERTS
#define ENABLE_ASSERTS
#endif
#endif
// -----------------------------
......
// If you are compiling dlib as a shared library and installing it somewhere on your system
// then it is important that any programs that use dlib agree on the state of the
// DLIB_ASSERT statements (i.e. they are either always on or always off). Therefore,
// uncomment one of the following lines to force all DLIB_ASSERTs to either always on or
// always off. If you don't define one of these two macros then DLIB_ASSERT will toggle
// automatically depending on the state of certain other macros, which is not what you want
// when creating a shared library.
//#define ENABLE_ASSERTS // asserts always enabled
//#define DLIB_DISABLE_ASSERTS // asserts always disabled
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment