Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
stdafx.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef OPENTXS_CORE_STDAFX_HPP
4 #define OPENTXS_CORE_STDAFX_HPP
5 
6 #include <cstdint>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #define TYPE_1_CMD_1 1
13 #define TYPE_1_CMD_2 2
14 #define TYPE_1_CMD_3 3
15 #define TYPE_1_CMD_4 4
16 
17 #define CMD_TYPE_1 1
18 
19 #define OT_CMD_HEADER_SIZE 9
20 
21 typedef uint8_t BYTE;
22 typedef uint16_t USHORT;
23 
24 union u_header
25 {
27  struct
28  {
29  BYTE type_id; // 1 byte
30  BYTE command_id; // 1 byte
31  BYTE filler[2]; // 2 bytes padding
32  uint32_t size; // 4 bytes
33  BYTE checksum; // 1 byte
34  } fields; // 9 bytes total
35 };
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 
41 // NOTE: Turns out moneypunct kind of sucks.
42 // As a result, for internationalization purposes,
43 // these values have to be set here before compilation.
44 //
45 #define OT_THOUSANDS_SEP ","
46 #define OT_DECIMAL_POINT "."
47 
48 #ifdef OT_USE_CXX11
49 #undef OT_USE_CXX11
50 #endif
51 
52 #if defined(_MSC_VER)
53 #define OT_USE_CXX11
54 #elif(!defined(OPENTXS_NO_CXX11) && (__cplusplus >= 201103L))
55 #define OT_USE_CXX11
56 #endif
57 
58 #ifndef OT_USE_SCRIPT_CHAI
59 #define OT_USE_SCRIPT_CHAI
60 
61 #ifndef OPENTXS_CHAISCRIPT_5
62 #define OPENTXS_CHAISCRIPT_5
63 #endif
64 
65 #endif
66 #if defined(ANDROID) || defined(OT_KEYRING_IOS)
67 
68 // DON'T use ChaiScript on mobile devices
69 #undef OT_USE_SCRIPT_CHAI
70 
71 #ifdef OPENTXS_CHAISCRIPT_5
72 #undef OPENTXS_CHAISCRIPT_5
73 #endif
74 
75 #endif
76 
77 #ifdef OT_USE_CHAI_STDLIB
78 #undef OT_USE_CHAI_STDLIB
79 #endif
80 
81 #ifdef OPENTXS_CHAISCRIPT_5
82 #define OT_USE_CHAI_STDLIB
83 #endif
84 
85 // for mac, this enables deprecated functions. (aka, for pthread)
86 #ifdef _XOPEN_SOURCE
87 #undef _XOPEN_SOURCE
88 #endif
89 
90 // define fstream while _XOPEN_SOURCE isn't defined.
91 //#include <fstream>
92 
93 #if defined(__APPLE__) && defined(OPENTXS_XOPEN_SOURCE)
94 #define _XOPEN_SOURCE 500
95 #endif
96 
97 #ifdef _WIN32
98 #ifndef NO_OT_PCH
99 #else
100 #undef NO_OT_PCH
101 #endif
102 #endif
103 
104 #endif // OPENTXS_CORE_STDAFX_HPP
BYTE buf[OT_CMD_HEADER_SIZE]
Definition: stdafx.hpp:26
uint32_t size
Definition: stdafx.hpp:32
BYTE filler[2]
Definition: stdafx.hpp:31
struct u_header::@0 fields
#define OT_CMD_HEADER_SIZE
Definition: stdafx.hpp:19
uint8_t BYTE
Definition: stdafx.hpp:21
BYTE command_id
Definition: stdafx.hpp:30
BYTE type_id
Definition: stdafx.hpp:29
uint16_t USHORT
Definition: stdafx.hpp:22
BYTE checksum
Definition: stdafx.hpp:33