mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-30 10:58:24 +00:00
Use C++11 [[noreturn]] attribute directly
Keep SOCI_NORETURN defined just in case somebody uses it in their own code, but stop using it in SOCI and just use the standard C++11 attribute directly instead.
This commit is contained in:
@@ -8,15 +8,7 @@
|
||||
#ifndef SOCI_NORETURN_H_INCLUDED
|
||||
#define SOCI_NORETURN_H_INCLUDED
|
||||
|
||||
// Define a portable SOCI_NORETURN macro.
|
||||
//
|
||||
// TODO-C++11: Use [[noreturn]] attribute.
|
||||
#if defined(__GNUC__)
|
||||
# define SOCI_NORETURN __attribute__((noreturn)) void
|
||||
#elif defined(_MSC_VER)
|
||||
# define SOCI_NORETURN __declspec(noreturn) void
|
||||
#else
|
||||
# define SOCI_NORETURN void
|
||||
#endif
|
||||
// This is defined only for compatibility, don't use it any longer.
|
||||
#define SOCI_NORETURN [[noreturn]] void
|
||||
|
||||
#endif // SOCI_NORETURN_H_INCLUDED
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "soci/bind-values.h"
|
||||
#include "soci/into-type.h"
|
||||
#include "soci/into.h"
|
||||
#include "soci/noreturn.h"
|
||||
#include "soci/use-type.h"
|
||||
#include "soci/use.h"
|
||||
#include "soci/soci-backend.h"
|
||||
@@ -99,7 +98,8 @@ private:
|
||||
// after adding the context in which it happened, including the provided
|
||||
// description of the operation that failed, the SQL query and, if
|
||||
// applicable, its parameters.
|
||||
SOCI_NORETURN rethrow_current_exception_with_context(char const* operation);
|
||||
[[noreturn]]
|
||||
void rethrow_current_exception_with_context(char const* operation);
|
||||
|
||||
int refCount_;
|
||||
|
||||
|
||||
@@ -897,7 +897,8 @@ statement_impl::make_vector_use_type_backend()
|
||||
return backEnd_->make_vector_use_type_backend();
|
||||
}
|
||||
|
||||
SOCI_NORETURN
|
||||
[[noreturn]]
|
||||
void
|
||||
statement_impl::rethrow_current_exception_with_context(char const* operation)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user