Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
e7194890
Commit
e7194890
authored
Dec 04, 2012
by
liujisi@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make PROTOBUF_USE_EXCEPTIONS configurable from CPPFLAGS.
parent
caa66db0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
common.cc
src/google/protobuf/stubs/common.cc
+2
-2
common.h
src/google/protobuf/stubs/common.h
+9
-4
No files found.
src/google/protobuf/stubs/common.cc
View file @
e7194890
...
@@ -191,7 +191,7 @@ void LogMessage::Finish() {
...
@@ -191,7 +191,7 @@ void LogMessage::Finish() {
}
}
if
(
level_
==
LOGLEVEL_FATAL
)
{
if
(
level_
==
LOGLEVEL_FATAL
)
{
#if
def
PROTOBUF_USE_EXCEPTIONS
#if PROTOBUF_USE_EXCEPTIONS
throw
FatalException
(
filename_
,
line_
,
message_
);
throw
FatalException
(
filename_
,
line_
,
message_
);
#else
#else
abort
();
abort
();
...
@@ -383,7 +383,7 @@ void ShutdownProtobufLibrary() {
...
@@ -383,7 +383,7 @@ void ShutdownProtobufLibrary() {
internal
::
shutdown_functions_mutex
=
NULL
;
internal
::
shutdown_functions_mutex
=
NULL
;
}
}
#if
def
PROTOBUF_USE_EXCEPTIONS
#if PROTOBUF_USE_EXCEPTIONS
FatalException
::~
FatalException
()
throw
()
{}
FatalException
::~
FatalException
()
throw
()
{}
const
char
*
FatalException
::
what
()
const
throw
()
{
const
char
*
FatalException
::
what
()
const
throw
()
{
...
...
src/google/protobuf/stubs/common.h
View file @
e7194890
...
@@ -48,12 +48,17 @@
...
@@ -48,12 +48,17 @@
#include <stdint.h>
#include <stdint.h>
#endif
#endif
#ifndef PROTOBUF_USE_EXCEPTIONS
#if defined(_MSC_VER) && defined(_CPPUNWIND)
#if defined(_MSC_VER) && defined(_CPPUNWIND)
#define PROTOBUF_USE_EXCEPTIONS
#define PROTOBUF_USE_EXCEPTIONS
1
#elif defined(__EXCEPTIONS)
#elif defined(__EXCEPTIONS)
#define PROTOBUF_USE_EXCEPTIONS
#define PROTOBUF_USE_EXCEPTIONS 1
#else
#define PROTOBUF_USE_EXCEPTIONS 0
#endif
#endif
#endif
#ifdef PROTOBUF_USE_EXCEPTIONS
#if PROTOBUF_USE_EXCEPTIONS
#include <exception>
#include <exception>
#endif
#endif
...
@@ -1188,7 +1193,7 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)());
...
@@ -1188,7 +1193,7 @@ LIBPROTOBUF_EXPORT void OnShutdown(void (*func)());
}
// namespace internal
}
// namespace internal
#if
def
PROTOBUF_USE_EXCEPTIONS
#if PROTOBUF_USE_EXCEPTIONS
class
FatalException
:
public
std
::
exception
{
class
FatalException
:
public
std
::
exception
{
public
:
public
:
FatalException
(
const
char
*
filename
,
int
line
,
const
std
::
string
&
message
)
FatalException
(
const
char
*
filename
,
int
line
,
const
std
::
string
&
message
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment