|
81 | 81 | #endif
|
82 | 82 |
|
83 | 83 | #ifndef FASTFLOAT_ASSERT
|
84 |
| -#define FASTFLOAT_ASSERT(x) { if (!(x)) abort(); } |
| 84 | +#define FASTFLOAT_ASSERT(x) { ((void)(x)); } |
85 | 85 | #endif
|
86 | 86 |
|
87 | 87 | #ifndef FASTFLOAT_DEBUG_ASSERT
|
88 |
| -#include <cassert> |
89 |
| -#define FASTFLOAT_DEBUG_ASSERT(x) assert(x) |
| 88 | +#define FASTFLOAT_DEBUG_ASSERT(x) { ((void)(x)); } |
90 | 89 | #endif
|
91 | 90 |
|
92 | 91 | // rust style `try!()` macro, or `?` operator
|
@@ -453,6 +452,23 @@ fastfloat_really_inline void to_float(bool negative, adjusted_mantissa am, T &va
|
453 | 452 | #endif
|
454 | 453 | }
|
455 | 454 |
|
| 455 | +#if FASTFLOAT_SKIP_WHITE_SPACE // disabled by default |
| 456 | +inline bool is_space(uint8_t c) { |
| 457 | + static const bool table[] = { |
| 458 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 459 | + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 460 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 461 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 462 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 463 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 464 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 465 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 466 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 467 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 468 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
| 469 | + return table[c]; |
| 470 | + } |
| 471 | +#endif |
456 | 472 | } // namespace fast_float
|
457 | 473 |
|
458 | 474 | #endif
|
0 commit comments