Skip to content

Commit a24e701

Browse files
committed
First release (0.0.1)
1 parent 2228c7c commit a24e701

6 files changed

Lines changed: 433 additions & 372 deletions

File tree

amalgamation.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ $SCRIPTPATH/src/parsedjsoniterator.cpp
2424

2525
# order matters
2626
ALLCHEADERS="
27+
$SCRIPTPATH/include/simdjson/simdjson_version.h
2728
$SCRIPTPATH/include/simdjson/portability.h
2829
$SCRIPTPATH/include/simdjson/common_defs.h
2930
$SCRIPTPATH/include/simdjson/jsoncharutils.h

include/simdjson/common_defs.h

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
#ifndef SIMDJSON_COMMON_DEFS_H
2-
#define SIMDJSON_COMMON_DEFS_H
3-
4-
#include "simdjson/portability.h"
5-
6-
#include <cassert>
7-
8-
// the input buf should be readable up to buf + SIMDJSON_PADDING
9-
#define SIMDJSON_PADDING sizeof(__m256i)
10-
11-
#ifndef _MSC_VER
12-
// Implemented using Labels as Values which works in GCC and CLANG (and maybe
13-
// also in Intel's compiler), but won't work in MSVC.
14-
#define SIMDJSON_USE_COMPUTED_GOTO
15-
#endif
16-
17-
18-
19-
20-
// Align to N-byte boundary
21-
#define ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
22-
#define ROUNDDOWN_N(a, n) ((a) & ~((n)-1))
23-
24-
#define ISALIGNED_N(ptr, n) (((uintptr_t)(ptr) & ((n)-1)) == 0)
25-
26-
#ifdef _MSC_VER
27-
28-
29-
#define really_inline inline
30-
#define never_inline __declspec(noinline)
31-
32-
#define UNUSED
33-
#define WARN_UNUSED
34-
35-
#ifndef likely
36-
#define likely(x) x
37-
#endif
38-
#ifndef unlikely
39-
#define unlikely(x) x
40-
#endif
41-
42-
#else
43-
44-
#define really_inline inline __attribute__((always_inline, unused))
45-
#define never_inline inline __attribute__((noinline, unused))
46-
47-
#define UNUSED __attribute__((unused))
48-
#define WARN_UNUSED __attribute__((warn_unused_result))
49-
50-
#ifndef likely
51-
#define likely(x) __builtin_expect(!!(x), 1)
52-
#endif
53-
#ifndef unlikely
54-
#define unlikely(x) __builtin_expect(!!(x), 0)
55-
#endif
56-
57-
#endif // MSC_VER
58-
59-
#endif // SIMDJSON_COMMON_DEFS_H
1+
#ifndef SIMDJSON_COMMON_DEFS_H
2+
#define SIMDJSON_COMMON_DEFS_H
3+
4+
#include "simdjson/portability.h"
5+
6+
#include <cassert>
7+
8+
// the input buf should be readable up to buf + SIMDJSON_PADDING
9+
#define SIMDJSON_PADDING sizeof(__m256i)
10+
11+
#ifndef _MSC_VER
12+
// Implemented using Labels as Values which works in GCC and CLANG (and maybe
13+
// also in Intel's compiler), but won't work in MSVC.
14+
#define SIMDJSON_USE_COMPUTED_GOTO
15+
#endif
16+
17+
18+
19+
20+
// Align to N-byte boundary
21+
#define ROUNDUP_N(a, n) (((a) + ((n)-1)) & ~((n)-1))
22+
#define ROUNDDOWN_N(a, n) ((a) & ~((n)-1))
23+
24+
#define ISALIGNED_N(ptr, n) (((uintptr_t)(ptr) & ((n)-1)) == 0)
25+
26+
#ifdef _MSC_VER
27+
28+
29+
#define really_inline inline
30+
#define never_inline __declspec(noinline)
31+
32+
#define UNUSED
33+
#define WARN_UNUSED
34+
35+
#ifndef likely
36+
#define likely(x) x
37+
#endif
38+
#ifndef unlikely
39+
#define unlikely(x) x
40+
#endif
41+
42+
#else
43+
44+
#define really_inline inline __attribute__((always_inline, unused))
45+
#define never_inline inline __attribute__((noinline, unused))
46+
47+
#define UNUSED __attribute__((unused))
48+
#define WARN_UNUSED __attribute__((warn_unused_result))
49+
50+
#ifndef likely
51+
#define likely(x) __builtin_expect(!!(x), 1)
52+
#endif
53+
#ifndef unlikely
54+
#define unlikely(x) __builtin_expect(!!(x), 0)
55+
#endif
56+
57+
#endif // MSC_VER
58+
59+
#endif // SIMDJSON_COMMON_DEFS_H
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// /include/simdjson/simdjson_version.h automatically generated by release.py, do not change by hand
2+
#ifndef SIMDJSON_INCLUDE_SIMDJSON_VERSION
3+
#define SIMDJSON_INCLUDE_SIMDJSON_VERSION
4+
#define SIMDJSON_VERSION = 0.0.1,
5+
enum {
6+
SIMDJSON_VERSION_MAJOR = 0,
7+
SIMDJSON_VERSION_MINOR = 0,
8+
SIMDJSON_VERSION_REVISION = 1
9+
};
10+
#endif // SIMDJSON_INCLUDE_SIMDJSON_VERSION

singleheader/amalgamation_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Tue 26 Feb 13:29:52 AEDT 2019. Do not edit! */
1+
/* auto-generated on Tue 26 Feb 2019 10:14:31 EST. Do not edit! */
22

33
#include <iostream>
44
#include "simdjson.h"

0 commit comments

Comments
 (0)