mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 17:56:13 -04:00
Renamed Assert.h to Assertion.h for Win32 build
- MSVC was confused about cassert/assert.h vs Assert.h
This commit is contained in:
parent
256dedfa1e
commit
c84e5122d3
@ -16,9 +16,9 @@ if (SQLITE_ENABLE_COLUMN_METADATA)
|
|||||||
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA)
|
add_definitions(-DSQLITE_ENABLE_COLUMN_METADATA)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Enable the user defintion of a assertion_failed() handler.
|
||||||
add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER)
|
add_definitions(-DSQLITECPP_ENABLE_ASSERT_HANDLER)
|
||||||
|
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
# build the SQLite3 C library for Windows (for ease of use)
|
# build the SQLite3 C library for Windows (for ease of use)
|
||||||
add_subdirectory (sqlite3)
|
add_subdirectory (sqlite3)
|
||||||
|
@ -217,7 +217,7 @@ namespace SQLite
|
|||||||
void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg)
|
void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg)
|
||||||
{
|
{
|
||||||
// Print a message to the standard error output stream, and abort the program.
|
// Print a message to the standard error output stream, and abort the program.
|
||||||
std::cerr << apFile << ":" << apLine << ":" << " error: assertion (" << apExpr << ") failed in '" << apFunc << "' (" << apMsg << ")\n";
|
std::cerr << apFile << ":" << apLine << ":" << " error: assertion failed (" << apExpr << ") in " << apFunc << "() with message \"" << apMsg << "\"\n";
|
||||||
std::abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ namespace SQLite
|
|||||||
void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg)
|
void assertion_failed(const char* apFile, const long apLine, const char* apFunc, const char* apExpr, const char* apMsg)
|
||||||
{
|
{
|
||||||
// Print a message to the standard error output stream, and abort the program.
|
// Print a message to the standard error output stream, and abort the program.
|
||||||
std::cerr << apFile << ":" << apLine << ":" << " error: assertion (" << apExpr << ") failed in " << apFunc << ": '" << apMsg << "'\n";
|
std::cerr << apFile << ":" << apLine << ":" << " error: assertion failed (" << apExpr << ") in " << apFunc << "() with message \"" << apMsg << "\"\n";
|
||||||
std::abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file Assert.h
|
* @file Assertion.h
|
||||||
* @ingroup SQLiteCpp
|
* @ingroup SQLiteCpp
|
||||||
* @brief Definition of the SQLITECPP_ASSERT() macro.
|
* @brief Definition of the SQLITECPP_ASSERT() macro.
|
||||||
*
|
*
|
||||||
@ -39,14 +39,8 @@ namespace SQLite
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
// if no assert handler provided by user code, use standard assert()
|
// if no assert handler provided by user code, use standard assert()
|
||||||
|
// (note: in debug mode, assert() does nothing)
|
||||||
#ifndef NDEBUG
|
#define SQLITECPP_ASSERT(expression,message) assert(expression && message)
|
||||||
// in debug mode, assert() :
|
|
||||||
#define SQLITECPP_ASSERT(expression,message) assert(expression)
|
|
||||||
#else
|
|
||||||
// in release mode, nothing :
|
|
||||||
#define SQLITECPP_ASSERT(expression,message) (expression)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -12,7 +12,7 @@
|
|||||||
# add sources of the wrapper as a "SQLiteCpp" static library
|
# add sources of the wrapper as a "SQLiteCpp" static library
|
||||||
add_library (SQLiteCpp
|
add_library (SQLiteCpp
|
||||||
SQLiteC++.h
|
SQLiteC++.h
|
||||||
Assert.h
|
Assertion.h
|
||||||
Column.cpp
|
Column.cpp
|
||||||
Column.h
|
Column.h
|
||||||
Database.cpp
|
Database.cpp
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "Database.h"
|
#include "Database.h"
|
||||||
|
|
||||||
#include "Statement.h"
|
#include "Statement.h"
|
||||||
#include "Assert.h"
|
#include "Assertion.h"
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Include useful headers of SQLiteC++
|
// Include useful headers of SQLiteC++
|
||||||
#include "Assert.h"
|
#include "Assertion.h"
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
#include "Database.h"
|
#include "Database.h"
|
||||||
#include "Statement.h"
|
#include "Statement.h"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#include "Database.h"
|
#include "Database.h"
|
||||||
#include "Column.h"
|
#include "Column.h"
|
||||||
#include "Assert.h"
|
#include "Assertion.h"
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "Transaction.h"
|
#include "Transaction.h"
|
||||||
|
|
||||||
#include "Database.h"
|
#include "Database.h"
|
||||||
#include "Assert.h"
|
#include "Assertion.h"
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user