Skip to content

Commit 588948d

Browse files
Start development of TinyCBOR 0.5
This commit creates the tinycbor-version.h file with the version number in available to source code. Signed-off-by: Thiago Macieira <[email protected]>
1 parent 726b786 commit 588948d

File tree

6 files changed

+23
-2
lines changed

6 files changed

+23
-2
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,4 @@ cflags += -std=c99 $(CFLAGS)
192192
@test -d $(@D) || $(MKDIR) $(@D)
193193
$(CC) $(cflags) $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<
194194

195+
-include src/*.d

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.1
1+
0.5

maketag.pl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ (@)
5757
system("git", "tag", "-a", "-F", $tagfile, split(' ', $ENV{GITTAGFLAGS}), "v$v");
5858
exit ($? >> 8) if $?;
5959

60-
# Update the version file for the next patch release
60+
# Update the version files for the next patch release
6161
@v = split(/\./, $v);
6262
if (scalar @v < 3) {
6363
push @v, '1';
@@ -67,3 +67,14 @@ (@)
6767
$v = join('.', @v);
6868
open VERSION, ">", "VERSION" or die("Cannot open VERSION file: $!");
6969
print VERSION "$v\n";
70+
close VERSION;
71+
72+
open VERSION, ">", "src/tinycbor-version.h" or die("Cannot open src/tinycbor-version.h: $!");
73+
print VERSION, "#define TINYCBOR_VERSION_MAJOR ", $v[0], "\n";
74+
print VERSION, "#define TINYCBOR_VERSION_MINOR ", $v[1], "\n";
75+
print VERSION, "#define TINYCBOR_VERSION_PATCH ", $v[2], "\n";
76+
close VERSION;
77+
78+
# Print summary
79+
print "Tag created and next versions updated.\n";
80+
print "Don't forget to create the docs.\n" if $v[2] == 1;

src/cbor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include <string.h>
3333
#include <stdio.h>
3434

35+
#include "tinycbor-version.h"
36+
37+
#define TINYCBOR_VERSION ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH)
38+
3539
#ifdef __cplusplus
3640
extern "C" {
3741
#else

src/src.pri

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ SOURCES += \
77
$$PWD/cborpretty.c \
88
$$PWD/cbortojson.c \
99

10+
HEADERS += $$PWD/cbor.h $$PWD/tinycbor-version.h
11+
1012
QMAKE_CFLAGS *= $$QMAKE_CFLAGS_SPLIT_SECTIONS
1113
QMAKE_LFLAGS *= $$QMAKE_LFLAGS_GCSECTIONS
1214
INCLUDEPATH += $$PWD

src/tinycbor-version.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define TINYCBOR_VERSION_MAJOR 0
2+
#define TINYCBOR_VERSION_MINOR 5
3+
#define TINYCBOR_VERSION_PATCH 0

0 commit comments

Comments
 (0)