1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
|
From: Lennart Weller <lhw@ring0.de>
Date: Tue, 20 Nov 2018 10:48:59 +0100
Subject: remove unnecessary includes in addition to adding modp_stdint.h to
the package
---
src/Makefile.am | 2 +-
src/modp_ascii.h | 8 ++++++--
src/modp_b16.h | 8 ++++++--
src/modp_b2.h | 8 ++++++--
src/modp_b36.h | 8 ++++++--
src/modp_b64.h | 8 ++++++--
src/modp_b64w.h | 8 ++++++--
src/modp_b85.h | 8 ++++++--
src/modp_bjavascript.h | 8 ++++++--
src/modp_numtoa.h | 8 ++++++--
src/modp_qsiter.h | 8 ++++++--
src/modp_utf8.h | 8 ++++++--
12 files changed, 67 insertions(+), 23 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index add0026..af23d48 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,7 @@ include_HEADERS = \
modp_b16.h modp_b64.h modp_b64w.h modp_b64r.h \
modp_b85.h modp_burl.h modp_bjavascript.h \
modp_numtoa.h modp_ascii.h modp_b2.h \
- modp_qsiter.h modp_xml.h modp_html.h modp_json.h
+ modp_qsiter.h modp_xml.h modp_html.h modp_json.h modp_stdint.h
lib_LTLIBRARIES = libmodpbase64.la
libmodpbase64_la_SOURCES = \
diff --git a/src/modp_ascii.h b/src/modp_ascii.h
index bb042ea..9bad7ac 100644
--- a/src/modp_ascii.h
+++ b/src/modp_ascii.h
@@ -22,7 +22,9 @@
#ifndef COM_MODP_STRINGENCODERS_ASCII
#define COM_MODP_STRINGENCODERS_ASCII
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/*
@@ -103,7 +105,9 @@ void modp_toprint_copy(char* dest, const char* str, size_t len);
*/
size_t modp_rtrim(char* str, size_t len);
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <string>
diff --git a/src/modp_b16.h b/src/modp_b16.h
index abee6e9..8641ceb 100644
--- a/src/modp_b16.h
+++ b/src/modp_b16.h
@@ -21,7 +21,9 @@
#ifndef COM_MODP_STRINGENCODERS_B16
#define COM_MODP_STRINGENCODERS_B16
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/**
@@ -63,7 +65,9 @@ size_t modp_b16_decode(char* dest, const char* src, size_t len);
*/
#define modp_b16_decode_len(A) ((A + 1) / 2)
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <cstring>
diff --git a/src/modp_b2.h b/src/modp_b2.h
index 037a40f..7b23424 100644
--- a/src/modp_b2.h
+++ b/src/modp_b2.h
@@ -20,7 +20,9 @@
#ifndef COM_MODP_STRINGENCODERS_B2
#define COM_MODP_STRINGENCODERS_B2
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/**
@@ -62,7 +64,9 @@ size_t modp_b2_decode(char* dest, const char* src, size_t len);
*/
#define modp_b2_decode_len(A) ((A + 1) / 8)
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <string>
diff --git a/src/modp_b36.h b/src/modp_b36.h
index cfa52e5..a07d31d 100644
--- a/src/modp_b36.h
+++ b/src/modp_b36.h
@@ -27,7 +27,9 @@
#ifndef COM_MODP_STRINGENCODERS_B36
#define COM_MODP_STRINGENCODERS_B36
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/**
@@ -70,7 +72,9 @@ size_t modp_b36_decode(char* dest, const char* src, size_t len);
*/
#define modp_b36_decode_len(A) ((A + 4) / 5 * 4)
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <cstring>
diff --git a/src/modp_b64.h b/src/modp_b64.h
index 3e03ac5..7e6f285 100644
--- a/src/modp_b64.h
+++ b/src/modp_b64.h
@@ -30,7 +30,9 @@
#ifndef COM_MODP_STRINGENCODERS_B64
#define COM_MODP_STRINGENCODERS_B64
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/**
@@ -132,7 +134,9 @@ size_t modp_b64_decode(char* dest, const char* src, size_t len);
*/
#define modp_b64_encode_strlen(A) ((A + 2) / 3 * 4)
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <cstring>
diff --git a/src/modp_b64w.h b/src/modp_b64w.h
index 0820867..b683b60 100644
--- a/src/modp_b64w.h
+++ b/src/modp_b64w.h
@@ -25,7 +25,9 @@
#ifndef COM_MODP_STRINGENCODERS_B64W
#define COM_MODP_STRINGENCODERS_B64W
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/**
@@ -126,7 +128,9 @@ size_t modp_b64w_decode(char* dest, const char* src, size_t len);
*/
#define modp_b64w_encode_strlen(A) ((A + 2) / 3 * 4)
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <cstring>
diff --git a/src/modp_b85.h b/src/modp_b85.h
index 93500da..0cfcedc 100644
--- a/src/modp_b85.h
+++ b/src/modp_b85.h
@@ -27,7 +27,9 @@
#ifndef COM_MODP_STRINGENCODERS_B85
#define COM_MODP_STRINGENCODERS_B85
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
/**
@@ -70,7 +72,9 @@ size_t modp_b85_decode(char* dest, const char* src, size_t len);
*/
#define modp_b85_decode_len(A) ((A + 4) / 5 * 4)
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <cstring>
diff --git a/src/modp_bjavascript.h b/src/modp_bjavascript.h
index 90741a1..d24e71f 100644
--- a/src/modp_bjavascript.h
+++ b/src/modp_bjavascript.h
@@ -34,7 +34,9 @@
#include "modp_stdint.h"
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* "javascript" encode a stirng
@@ -67,7 +69,9 @@ size_t modp_bjavascript_encode(char* dest, const char* str, size_t len);
*/
size_t modp_bjavascript_encode_strlen(const char* str, size_t len);
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#ifdef __cplusplus
#include <cstring>
diff --git a/src/modp_numtoa.h b/src/modp_numtoa.h
index 863aa17..844da63 100644
--- a/src/modp_numtoa.h
+++ b/src/modp_numtoa.h
@@ -24,7 +24,9 @@
#ifndef COM_MODP_STRINGENCODERS_NUMTOA_H
#define COM_MODP_STRINGENCODERS_NUMTOA_H
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
@@ -95,6 +97,8 @@ size_t modp_dtoa2(double value, char* buf, int precision);
*/
char* modp_uitoa16(uint32_t value, char* buf, int final);
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/src/modp_qsiter.h b/src/modp_qsiter.h
index a0c3132..d3d4ddc 100644
--- a/src/modp_qsiter.h
+++ b/src/modp_qsiter.h
@@ -3,7 +3,9 @@
#include <string.h>
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* \file modp_qsiter.h
@@ -66,6 +68,8 @@ void qsiter_reset(struct qsiter_t* qsi, const char* s, size_t len);
*/
int qsiter_next(struct qsiter_t* qsi);
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#endif /* MODP_QSITER */
diff --git a/src/modp_utf8.h b/src/modp_utf8.h
index 5186f5c..9017b12 100644
--- a/src/modp_utf8.h
+++ b/src/modp_utf8.h
@@ -20,7 +20,9 @@
#ifndef COM_MODP_UTF8
#define COM_MODP_UTF8
-#include "extern_c_begin.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
#include "modp_stdint.h"
#define MODP_UTF8_OK 0
@@ -34,5 +36,7 @@
*/
int modp_utf8_validate(const char* src, size_t len);
-#include "extern_c_end.h"
+#ifdef __cplusplus
+}
+#endif
#endif /* ifndef modp_utf8 */
|