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
1accc9a1
Commit
1accc9a1
authored
Jul 18, 2017
by
Edward Catmur
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into fsanitize-vptr
parents
3713c573
e651ac5f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
Makefile.am
c++/Makefile.am
+1
-1
exception.c++
c++/src/kj/exception.c++
+1
-1
language.md
doc/language.md
+10
-8
No files found.
c++/Makefile.am
View file @
1accc9a1
...
@@ -114,7 +114,7 @@ includekjcompatdir = $(includekjdir)/compat
...
@@ -114,7 +114,7 @@ includekjcompatdir = $(includekjdir)/compat
dist_includecapnp_DATA
=
$(public_capnpc_inputs)
dist_includecapnp_DATA
=
$(public_capnpc_inputs)
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfig_DATA
=
capnp.pc capnp-rpc.pc kj.pc kj-async.pc
pkgconfig_DATA
=
capnp.pc capnp-rpc.pc
capnp-json.pc
kj.pc kj-async.pc
noinst_HEADERS
=
\
noinst_HEADERS
=
\
src/kj/miniposix.h
src/kj/miniposix.h
...
...
c++/src/kj/exception.c++
View file @
1accc9a1
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#endif
#endif
#include "io.h"
#include "io.h"
#if (__linux__ && __GLIBC__) || __APPLE__
#if (__linux__ && __GLIBC__
&& !__UCLIBC__
) || __APPLE__
#define KJ_HAS_BACKTRACE 1
#define KJ_HAS_BACKTRACE 1
#include <execinfo.h>
#include <execinfo.h>
#endif
#endif
...
...
doc/language.md
View file @
1accc9a1
...
@@ -138,11 +138,11 @@ struct Person {
...
@@ -138,11 +138,11 @@ struct Person {
# ...
# ...
employment :union {
employment :union {
# We assume that a person is only one of these.
unemployed @4 :Void;
unemployed @4 :Void;
employer @5 :Company;
employer @5 :Company;
school @6 :School;
school @6 :School;
selfEmployed @7 :Void;
selfEmployed @7 :Void;
# We assume that a person is only one of these.
}
}
}
}
{% endhighlight %}
{% endhighlight %}
...
@@ -222,9 +222,9 @@ A group is a set of fields that are encapsulated in their own scope.
...
@@ -222,9 +222,9 @@ A group is a set of fields that are encapsulated in their own scope.
struct Person {
struct Person {
# ...
# ...
address :group {
# Note: This is a terrible way to use groups, and meant
# Note: This is a terrible way to use groups, and meant
# only to demonstrate the syntax.
# only to demonstrate the syntax.
address :group {
houseNumber @8 :UInt32;
houseNumber @8 :UInt32;
street @9 :Text;
street @9 :Text;
city @10 :Text;
city @10 :Text;
...
@@ -542,8 +542,8 @@ An `import` expression names the scope of some other file:
...
@@ -542,8 +542,8 @@ An `import` expression names the scope of some other file:
{% highlight capnp %}
{% highlight capnp %}
struct Foo {
struct Foo {
# Use type "Baz" defined in bar.capnp.
baz @0 :import "bar.capnp".Baz;
baz @0 :import "bar.capnp".Baz;
# Use type "Baz" defined in bar.capnp.
}
}
{% endhighlight %}
{% endhighlight %}
...
@@ -553,8 +553,8 @@ Of course, typically it's more readable to define an alias:
...
@@ -553,8 +553,8 @@ Of course, typically it's more readable to define an alias:
using Bar = import "bar.capnp";
using Bar = import "bar.capnp";
struct Foo {
struct Foo {
# Use type "Baz" defined in bar.capnp.
baz @0 :Bar.Baz;
baz @0 :Bar.Baz;
# Use type "Baz" defined in bar.capnp.
}
}
{% endhighlight %}
{% endhighlight %}
...
@@ -565,6 +565,7 @@ using import "bar.capnp".Baz;
...
@@ -565,6 +565,7 @@ using import "bar.capnp".Baz;
struct Foo {
struct Foo {
baz @0 :Baz;
baz @0 :Baz;
# Use type "Baz" defined in bar.capnp.
}
}
{% endhighlight %}
{% endhighlight %}
...
@@ -584,11 +585,12 @@ removes all of these hidden fields.
...
@@ -584,11 +585,12 @@ removes all of these hidden fields.
You may declare annotations and use them like so:
You may declare annotations and use them like so:
{% highlight capnp %}
{% highlight capnp %}
# Declare an annotation 'foo' which applies to struct and enum types.
annotation foo(struct, enum) :Text;
annotation foo(struct, enum) :Text;
# Declare an annotation 'foo' which applies to struct and enum types.
# Apply 'foo' to to MyType.
struct MyType $foo("bar") {
struct MyType $foo("bar") {
# Apply 'foo' to to MyType.
# ...
# ...
}
}
{% endhighlight %}
{% endhighlight %}
...
@@ -598,8 +600,8 @@ The possible targets for an annotation are: `file`, `struct`, `field`, `union`,
...
@@ -598,8 +600,8 @@ The possible targets for an annotation are: `file`, `struct`, `field`, `union`,
all.
all.
{% highlight capnp %}
{% highlight capnp %}
# 'baz' can annotate anything!
annotation baz(
*
) :Int32;
annotation baz(
*
) :Int32;
# 'baz' can annotate anything!
$baz(1); # Annotate the file.
$baz(1); # Annotate the file.
...
@@ -654,8 +656,8 @@ A Cap'n Proto file must have a unique 64-bit ID, and each type and annotation de
...
@@ -654,8 +656,8 @@ A Cap'n Proto file must have a unique 64-bit ID, and each type and annotation de
also have an ID. Use
`capnp id`
to generate a new ID randomly. ID specifications begin with
`@`
:
also have an ID. Use
`capnp id`
to generate a new ID randomly. ID specifications begin with
`@`
:
{% highlight capnp %}
{% highlight capnp %}
# file ID
@0xdbb9ad1f14bf0b36;
@0xdbb9ad1f14bf0b36;
# file ID
struct Foo @0x8db435604d0d3723 {
struct Foo @0x8db435604d0d3723 {
# ...
# ...
...
...
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