From da73ed316082e2d8e9f255443fb5e75e169f6cb4 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Wed, 25 Apr 2018 18:23:56 +0300 Subject: Update examples --- examples/simple/Makefile | 2 +- examples/simple/nim.cfg | 2 +- examples/simple/simple_pb.nim | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'examples/simple') diff --git a/examples/simple/Makefile b/examples/simple/Makefile index 1da2b45..4e03fe4 100644 --- a/examples/simple/Makefile +++ b/examples/simple/Makefile @@ -4,4 +4,4 @@ simple: simple.nim simple_pb.nim nim c $< %_pb.nim: %.proto - nimpb_build -I=. --out=. $< + ../../nimpb/compiler/nimpb_build -I=. --out=. $< diff --git a/examples/simple/nim.cfg b/examples/simple/nim.cfg index 11736fc..1c2f0c1 100644 --- a/examples/simple/nim.cfg +++ b/examples/simple/nim.cfg @@ -1 +1 @@ ---path:"../../src" +--path:"../.." diff --git a/examples/simple/simple_pb.nim b/examples/simple/simple_pb.nim index 56d4afb..a594803 100644 --- a/examples/simple/simple_pb.nim +++ b/examples/simple/simple_pb.nim @@ -18,6 +18,7 @@ type proc newTest1*(): Test1 proc newTest1*(data: string): Test1 +proc newTest1*(data: seq[byte]): Test1 proc writeTest1*(stream: Stream, message: Test1) proc readTest1*(stream: Stream): Test1 proc sizeOfTest1*(message: Test1): uint64 @@ -114,4 +115,9 @@ proc newTest1*(data: string): Test1 = ss = newStringStream(data) result = readTest1(ss) +proc newTest1*(data: seq[byte]): Test1 = + let + ss = newStringStream(cast[string](data)) + result = readTest1(ss) + -- cgit v1.2.3