Commit 3b0e4f1e authored by Kenton Varda's avatar Kenton Varda

Update capnpc-capnp to use KJ_MAIN.

parent 10697ea1
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
#include <capnp/serialize-packed.h> #include <capnp/serialize-packed.h>
#include <limits> #include <limits>
#if HAVE_CONFIG_H
#include "config.h"
#else
#define VERSION "(unknown ekam build)"
#endif
namespace capnp { namespace capnp {
namespace compiler { namespace compiler {
...@@ -65,7 +71,7 @@ public: ...@@ -65,7 +71,7 @@ public:
} }
}; };
static const char VERSION_STRING[] = "Cap'n Proto version 0.2"; static const char VERSION_STRING[] = "Cap'n Proto version " VERSION;
class CompilerMain final: public GlobalErrorReporter { class CompilerMain final: public GlobalErrorReporter {
public: public:
......
This diff is collapsed.
...@@ -350,6 +350,11 @@ public: ...@@ -350,6 +350,11 @@ public:
template <typename Iterator> template <typename Iterator>
void addAll(Iterator start, Iterator end); void addAll(Iterator start, Iterator end);
void removeLast() {
KJ_IREQUIRE(pos > ptr, "No elements present to remove.");
kj::dtor(*--pos);
}
Array<T> finish() { Array<T> finish() {
// We could safely remove this check if we assume that the disposer implementation doesn't // We could safely remove this check if we assume that the disposer implementation doesn't
// need to know the original capacity, as is thes case with HeapArrayDisposer since it uses // need to know the original capacity, as is thes case with HeapArrayDisposer since it uses
......
...@@ -87,6 +87,10 @@ public: ...@@ -87,6 +87,10 @@ public:
addAll(container.begin(), container.end()); addAll(container.begin(), container.end());
} }
inline void removeLast() {
builder.removeLast();
}
private: private:
ArrayBuilder<T> builder; ArrayBuilder<T> builder;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment