Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
capnproto
Commits
80f24a34
Commit
80f24a34
authored
May 30, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks
parent
bdb86c21
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
common.h
c++/src/kj/common.h
+19
-7
exception.c++
c++/src/kj/exception.c++
+2
-2
util.h
c++/src/kj/util.h
+0
-4
No files found.
c++/src/kj/common.h
View file @
80f24a34
...
...
@@ -48,6 +48,8 @@
#warning "This library requires at least GCC 4.7."
#endif
#endif
#elif defined(_MSC_VER)
#warning "As of June 2013, Visual Studio's C++11 support was hopelessly behind what is needed to compile this code."
#endif
// =======================================================================================
...
...
@@ -60,19 +62,29 @@ typedef unsigned char byte;
// =======================================================================================
// Common macros, especially for common yet compiler-specific features.
#ifndef KJ_NO_RTTI
#ifdef __GNUC__
#if !__GXX_RTTI
#define KJ_NO_RTTI
// Detect whether RTTI and exceptions are enabled, assuming they are unless we have specific
// evidence to the contrary. Clients can always define KJ_NO_RTTI or KJ_NO_EXCEPTIONS explicitly
// to override these checks.
#ifdef __GNUC__
#if !defined(KJ_NO_RTTI) && !__GXX_RTTI
#define KJ_NO_RTTI 1
#endif
#if !defined(KJ_NO_EXCEPTIONS) && !__EXCEPTIONS
#define KJ_NO_EXCEPTIONS 1
#endif
#elif defined(_MSC_VER)
#if !defined(KJ_NO_RTTI) && !defined(_CPPRTTI)
#define KJ_NO_RTTI 1
#endif
#if !defined(KJ_NO_EXCEPTIONS) && !defined(_CPPUNWIND)
#define KJ_NO_EXCEPTIONS 1
#endif
#endif
#define KJ_DISALLOW_COPY(classname) \
classname(const classname&) = delete; \
classname& operator=(const classname&) = delete
#define KJ_OFFSETOF(type, member) __builtin_offsetof(type, member)
// Deletes the implicit copy constructor and assignment operator.
#define KJ_EXPECT_TRUE(condition) __builtin_expect(condition, true)
#define KJ_EXPECT_FALSE(condition) __builtin_expect(condition, false)
...
...
@@ -80,7 +92,7 @@ typedef unsigned char byte;
// expect the condition to be true/false enough of the time that it's worth hard-coding branch
// prediction.
#if
def NDEBUG
#if
defined(NDEBUG) && !__NO_INLINE__
#define KJ_ALWAYS_INLINE(prototype) inline prototype __attribute__((always_inline))
// Force a function to always be inlined. Apply only to the prototype, not to the definition.
#else
...
...
c++/src/kj/exception.c++
View file @
80f24a34
...
...
@@ -144,7 +144,7 @@ ExceptionCallback::~ExceptionCallback() {
}
void
ExceptionCallback
::
onRecoverableException
(
Exception
&&
exception
)
{
#if
__GNUC__ && !_
_EXCEPTIONS
#if
KJ_NO
_EXCEPTIONS
logMessage
(
str
(
exception
.
what
(),
'\n'
));
#else
if
(
std
::
uncaught_exception
())
{
...
...
@@ -156,7 +156,7 @@ void ExceptionCallback::onRecoverableException(Exception&& exception) {
}
void
ExceptionCallback
::
onFatalException
(
Exception
&&
exception
)
{
#if
__GNUC__ && !_
_EXCEPTIONS
#if
KJ_NO
_EXCEPTIONS
logMessage
(
str
(
exception
.
what
(),
'\n'
));
#else
throw
std
::
move
(
exception
);
...
...
c++/src/kj/util.h
View file @
80f24a34
...
...
@@ -183,10 +183,6 @@ struct Stringifier {
return
result
;
}
// inline ArrayPtr<const char> operator*(Text::Reader text) const {
// return arrayPtr(text.data(), text.size());
// }
CappedArray
<
char
,
sizeof
(
short
)
*
4
>
operator
*
(
short
i
)
const
;
CappedArray
<
char
,
sizeof
(
unsigned
short
)
*
4
>
operator
*
(
unsigned
short
i
)
const
;
CappedArray
<
char
,
sizeof
(
int
)
*
4
>
operator
*
(
int
i
)
const
;
...
...
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