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
b17b5ae8
Commit
b17b5ae8
authored
Nov 20, 2014
by
Kenton Varda
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #147 from teobugslayer/msvc
Accommodate code for MSVC
parents
1745aded
c1d3386d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
17 deletions
+26
-17
async-prelude.h
c++/src/kj/async-prelude.h
+1
-1
common.h
c++/src/kj/common.h
+15
-6
debug.h
c++/src/kj/debug.h
+1
-1
exception.h
c++/src/kj/exception.h
+1
-1
main.c++
c++/src/kj/main.c++
+2
-2
main.h
c++/src/kj/main.h
+6
-6
No files found.
c++/src/kj/async-prelude.h
View file @
b17b5ae8
...
...
@@ -191,7 +191,7 @@ public:
return
Promise
<
T
>
(
false
,
neverDone
());
}
void
wait
(
WaitScope
&
waitScope
)
const
KJ_NORETURN
;
KJ_NORETURN
(
void
wait
(
WaitScope
&
waitScope
)
const
)
;
};
}
// namespace _ (private)
...
...
c++/src/kj/common.h
View file @
b17b5ae8
...
...
@@ -126,11 +126,20 @@ typedef unsigned char byte;
#define KJ_ALWAYS_INLINE(prototype) inline prototype
// Don't force inline in debug mode.
#else
#if defined(_MSC_VER)
#define KJ_ALWAYS_INLINE(prototype) __forceinline prototype
#else
#define KJ_ALWAYS_INLINE(prototype) inline prototype __attribute__((always_inline))
#endif
// Force a function to always be inlined. Apply only to the prototype, not to the definition.
#endif
#define KJ_NORETURN __attribute__((noreturn))
#if defined(_MSC_VER)
#define KJ_NORETURN(prototype) __declspec(noreturn) prototype
#else
#define KJ_NORETURN(prototype) prototype __attribute__((noreturn))
#endif
#define KJ_UNUSED __attribute__((unused))
#define KJ_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
...
...
@@ -153,14 +162,14 @@ typedef unsigned char byte;
namespace
_
{
// private
void
inlineRequireFailure
(
KJ_NORETURN
(
void
inlineRequireFailure
(
const
char
*
file
,
int
line
,
const
char
*
expectation
,
const
char
*
macroArgs
,
const
char
*
message
=
nullptr
)
KJ_NORETURN
;
void
inlineAssertFailure
(
const
char
*
message
=
nullptr
)
)
;
KJ_NORETURN
(
void
inlineAssertFailure
(
const
char
*
file
,
int
line
,
const
char
*
expectation
,
const
char
*
macroArgs
,
const
char
*
message
=
nullptr
)
KJ_NORETURN
;
const
char
*
message
=
nullptr
)
)
;
void
unreachable
()
KJ_NORETURN
;
KJ_NORETURN
(
void
unreachable
())
;
}
// namespace _ (private)
...
...
c++/src/kj/debug.h
View file @
b17b5ae8
...
...
@@ -223,7 +223,7 @@ public:
const
char
*
condition
,
const
char
*
macroArgs
,
Params
&&
...
params
);
~
Fault
()
noexcept
(
false
);
void
fatal
()
KJ_NORETURN
;
KJ_NORETURN
(
void
fatal
())
;
// Throw the exception.
private
:
...
...
c++/src/kj/exception.h
View file @
b17b5ae8
...
...
@@ -184,7 +184,7 @@ private:
ExceptionCallback
&
getExceptionCallback
();
// Returns the current exception callback.
void
throwFatalException
(
kj
::
Exception
&&
exception
)
KJ_NORETURN
;
KJ_NORETURN
(
void
throwFatalException
(
kj
::
Exception
&&
exception
))
;
// Invoke the exception callback to throw the given fatal exception. If the exception callback
// returns, abort.
...
...
c++/src/kj/main.c++
View file @
b17b5ae8
...
...
@@ -382,8 +382,8 @@ public:
private
:
Own
<
Impl
>
impl
;
void
usageError
(
StringPtr
programName
,
StringPtr
message
)
KJ_NORETURN
;
void
printHelp
(
StringPtr
programName
)
KJ_NORETURN
;
KJ_NORETURN
(
void
usageError
(
StringPtr
programName
,
StringPtr
message
))
;
KJ_NORETURN
(
void
printHelp
(
StringPtr
programName
))
;
void
wrapText
(
Vector
<
char
>&
output
,
StringPtr
indent
,
StringPtr
text
);
};
...
...
c++/src/kj/main.h
View file @
b17b5ae8
...
...
@@ -36,7 +36,7 @@ public:
virtual
StringPtr
getProgramName
()
=
0
;
// Get argv[0] as passed to main().
virtual
void
exit
()
KJ_NORETURN
=
0
;
KJ_NORETURN
(
virtual
void
exit
())
=
0
;
// Indicates program completion. The program is considered successful unless `error()` was
// called. Typically this exits with _Exit(), meaning that the stack is not unwound, buffers
// are not flushed, etc. -- it is the responsibility of the caller to flush any buffers that
...
...
@@ -110,10 +110,10 @@ public:
// Like `warning()`, but also sets a flag indicating that the process has failed, and that when
// it eventually exits it should indicate an error status.
virtual
void
exitError
(
StringPtr
message
)
KJ_NORETURN
=
0
;
KJ_NORETURN
(
virtual
void
exitError
(
StringPtr
message
))
=
0
;
// Equivalent to `error(message)` followed by `exit()`.
virtual
void
exitInfo
(
StringPtr
message
)
KJ_NORETURN
=
0
;
KJ_NORETURN
(
virtual
void
exitInfo
(
StringPtr
message
))
=
0
;
// Displays the given non-error message to the user and then calls `exit()`. This is used to
// implement things like --help.
...
...
@@ -141,11 +141,11 @@ public:
// are easily confused by quick_exit().
StringPtr
getProgramName
()
override
;
void
exit
()
override
KJ_NORETURN
;
KJ_NORETURN
(
void
exit
()
override
)
;
void
warning
(
StringPtr
message
)
override
;
void
error
(
StringPtr
message
)
override
;
void
exitError
(
StringPtr
message
)
override
KJ_NORETURN
;
void
exitInfo
(
StringPtr
message
)
override
KJ_NORETURN
;
KJ_NORETURN
(
void
exitError
(
StringPtr
message
)
override
)
;
KJ_NORETURN
(
void
exitInfo
(
StringPtr
message
)
override
)
;
void
increaseLoggingVerbosity
()
override
;
private
:
...
...
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