mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
Merge pull request #199 from mayawarrier/cmake_intellisense_fix
Fix for broken VS Intellisense
This commit is contained in:
commit
cc1e01e9ee
18
.gitignore
vendored
18
.gitignore
vendored
@ -2,3 +2,21 @@ build/*
|
|||||||
Testing/*
|
Testing/*
|
||||||
.cache/
|
.cache/
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
|
||||||
|
# Visual Studio
|
||||||
|
.vs/
|
||||||
|
Debug/
|
||||||
|
Release/
|
||||||
|
*.sln
|
||||||
|
*.vcxproj
|
||||||
|
*.vcxproj.filters
|
||||||
|
*.vcxproj.user
|
||||||
|
*.psess
|
||||||
|
*.vspx
|
||||||
|
*.vsp
|
||||||
|
*.diagsession
|
||||||
|
*.hint
|
||||||
|
|
||||||
|
# VS CMake
|
||||||
|
/out/
|
||||||
|
/CMakeSettings.json
|
||||||
|
|||||||
@ -1,38 +1,10 @@
|
|||||||
|
|
||||||
#ifndef FASTFLOAT_FAST_FLOAT_H
|
#ifndef FASTFLOAT_FAST_FLOAT_H
|
||||||
#define FASTFLOAT_FAST_FLOAT_H
|
#define FASTFLOAT_FAST_FLOAT_H
|
||||||
|
|
||||||
#include <system_error>
|
#include "float_common.h"
|
||||||
|
|
||||||
#include "constexpr_feature_detect.h"
|
|
||||||
|
|
||||||
namespace fast_float {
|
namespace fast_float {
|
||||||
enum chars_format {
|
|
||||||
scientific = 1<<0,
|
|
||||||
fixed = 1<<2,
|
|
||||||
hex = 1<<3,
|
|
||||||
general = fixed | scientific
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename UC>
|
|
||||||
struct from_chars_result_t {
|
|
||||||
UC const * ptr;
|
|
||||||
std::errc ec;
|
|
||||||
};
|
|
||||||
using from_chars_result = from_chars_result_t<char>;
|
|
||||||
|
|
||||||
template <typename UC>
|
|
||||||
struct parse_options_t {
|
|
||||||
constexpr explicit parse_options_t(chars_format fmt = chars_format::general,
|
|
||||||
UC dot = UC('.'))
|
|
||||||
: format(fmt), decimal_point(dot) {}
|
|
||||||
|
|
||||||
/** Which number formats are accepted */
|
|
||||||
chars_format format;
|
|
||||||
/** The character used as decimal point */
|
|
||||||
UC decimal_point;
|
|
||||||
};
|
|
||||||
using parse_options = parse_options_t<char>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function parses the character sequence [first,last) for a number. It parses floating-point numbers expecting
|
* This function parses the character sequence [first,last) for a number. It parses floating-point numbers expecting
|
||||||
* a locale-indepent format equivalent to what is used by std::strtod in the default ("C") locale.
|
* a locale-indepent format equivalent to what is used by std::strtod in the default ("C") locale.
|
||||||
|
|||||||
@ -6,6 +6,40 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include <system_error>
|
||||||
|
|
||||||
|
#include "constexpr_feature_detect.h"
|
||||||
|
|
||||||
|
namespace fast_float {
|
||||||
|
|
||||||
|
enum chars_format {
|
||||||
|
scientific = 1 << 0,
|
||||||
|
fixed = 1 << 2,
|
||||||
|
hex = 1 << 3,
|
||||||
|
general = fixed | scientific
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename UC>
|
||||||
|
struct from_chars_result_t {
|
||||||
|
UC const* ptr;
|
||||||
|
std::errc ec;
|
||||||
|
};
|
||||||
|
using from_chars_result = from_chars_result_t<char>;
|
||||||
|
|
||||||
|
template <typename UC>
|
||||||
|
struct parse_options_t {
|
||||||
|
constexpr explicit parse_options_t(chars_format fmt = chars_format::general,
|
||||||
|
UC dot = UC('.'))
|
||||||
|
: format(fmt), decimal_point(dot) {}
|
||||||
|
|
||||||
|
/** Which number formats are accepted */
|
||||||
|
chars_format format;
|
||||||
|
/** The character used as decimal point */
|
||||||
|
UC decimal_point;
|
||||||
|
};
|
||||||
|
using parse_options = parse_options_t<char>;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#if FASTFLOAT_HAS_BIT_CAST
|
#if FASTFLOAT_HAS_BIT_CAST
|
||||||
#include <bit>
|
#include <bit>
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "ascii_number.h"
|
#include "ascii_number.h"
|
||||||
#include "decimal_to_binary.h"
|
#include "decimal_to_binary.h"
|
||||||
#include "digit_comparison.h"
|
#include "digit_comparison.h"
|
||||||
|
#include "float_common.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|||||||
@ -31,9 +31,8 @@ for filename in ['LICENSE-MIT', 'LICENSE-APACHE']:
|
|||||||
processed_files[filename] = text
|
processed_files[filename] = text
|
||||||
|
|
||||||
# code
|
# code
|
||||||
for filename in [ 'constexpr_feature_detect.h', 'fast_float.h', 'float_common.h', 'ascii_number.h',
|
for filename in [ 'constexpr_feature_detect.h', 'float_common.h', 'fast_float.h', 'ascii_number.h',
|
||||||
'fast_table.h', 'decimal_to_binary.h', 'bigint.h',
|
'fast_table.h', 'decimal_to_binary.h', 'bigint.h', 'digit_comparison.h', 'parse_number.h']:
|
||||||
'ascii_number.h', 'digit_comparison.h', 'parse_number.h']:
|
|
||||||
with open('include/fast_float/' + filename, encoding='utf8') as f:
|
with open('include/fast_float/' + filename, encoding='utf8') as f:
|
||||||
text = ''
|
text = ''
|
||||||
for line in f:
|
for line in f:
|
||||||
@ -76,11 +75,10 @@ text = ''.join([
|
|||||||
processed_files['AUTHORS'], processed_files['CONTRIBUTORS'],
|
processed_files['AUTHORS'], processed_files['CONTRIBUTORS'],
|
||||||
*license_content(args.license),
|
*license_content(args.license),
|
||||||
processed_files['constexpr_feature_detect.h'],
|
processed_files['constexpr_feature_detect.h'],
|
||||||
processed_files['fast_float.h'], processed_files['float_common.h'],
|
processed_files['float_common.h'], processed_files['fast_float.h'],
|
||||||
processed_files['ascii_number.h'], processed_files['fast_table.h'],
|
processed_files['ascii_number.h'], processed_files['fast_table.h'],
|
||||||
processed_files['decimal_to_binary.h'], processed_files['bigint.h'],
|
processed_files['decimal_to_binary.h'], processed_files['bigint.h'],
|
||||||
processed_files['ascii_number.h'], processed_files['digit_comparison.h'],
|
processed_files['digit_comparison.h'], processed_files['parse_number.h']])
|
||||||
processed_files['parse_number.h']])
|
|
||||||
|
|
||||||
if args.output:
|
if args.output:
|
||||||
with open(args.output, 'wt', encoding='utf8') as f:
|
with open(args.output, 'wt', encoding='utf8') as f:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user