Skip to content

Commit

Permalink
Squashed 'vendor/double-conversion/' changes from 9ed0dec..5cc233e
Browse files Browse the repository at this point in the history
5cc233e Add support for microblaze.
4a51e73 Add support for e2k architecture. (#118)
7da5db9 Add min exponent width option in double-to-string conversion (#116)
3f9cd30 Remove reference to `diy-fp.cc`
e424c2b More Bignum fiddling. (#108)
583c6b7 Merge branch 'master' of github.com:google/double-conversion
5720620 Remove redundant parenthesis.
7bc0c47 Optimise Bignum layout. (#107)
e67096c Split Strtod() (#106)
32c4026 Split double-conversion. (#104)
251fef6 Fix naming. (#103)
2c29075 Consistent macro prefix. (#101)
e394b49 Use standard min/max. (#102)
5fa81e8 Fix some issues with invalid hex-float literals.
fb2364d Improve gitignore.
8fcee05 Usefulcat master (#98)
067c887 Fix warning for g++ 4.9.3.
d1c0b80 Update Changelog.
4fa48d5 CMake: install to correct lib dir (#93)
cb5cf99 Add big endian ARM support (#92)
3dfc1e3 Switch to relative includes.
860b431 Fix typo in test.
53c4c75 Update Changelog and version number.
f5c59a2 Merge branch 'master' of github.com:google/double-conversion
8751aaf Fix 16-bit separators.
990c447 msvc: check if _MSC_VER is defined (#88)
87d21e3 Allow for compilation in emscripten (#86)
4b2a7f3 Merge branch 'branch_v3.1'
d583754 Add test cases.
9823421 Update version numbers.
eafa625 Add support of ARC architecture (#82)
4199ef3 Update version numbers.
e67d737 Merge branch 'master' into branch_v3.1
fd043b2 Fix hex literal bug.
20ecba5 Support separator characters.
05a3fea Add support for hexadecimal float literals.
aa554d9 Fix bug where hex numbers would lose the minus sign.
b479bea Add comments for achitecture check.
768a445 Add support for aarch64_be, or1k and microblazebe.
4e8b3b5 Add support for Windows on ARM and ARM64 (#76)
9a8e518 Merge pull request spotify#68 from floitschG/static_size_assert
ae9ad90 Merge pull request #69 from floitschG/pnacl
e543cca Add Native Client as support architecture.
da420c3 Use `static_assert` with newer compilers.
7a560cf Merge pull request spotify#65 from floitschG/avoid_undef_cast
3ef9576 Address comments.
df50df0 Avoid undefined cast to make ASAN happy.
3992066 Merge pull request spotify#64 from google/floitschG-patch-1
6c1e714 Add `exports_files`
3ad9d20 Processed length should include no trailing junk (spotify#63)
1b5fa31 Clarify output charset in DoubleToAscii documentation (spotify#61)
e1aa127 Fix warning for code that will never be executed (spotify#59)
cf2f0f3 Merge pull request spotify#57 from google/rename_macro
c58352d Rename macros.
fe9b384 Merge pull request spotify#52 from uburuntu/master
1d5a688 REF: replace deprecated headers
4873703 REF: meaningless static definition in anonymous namespace
14033f6 REF: init member in constructor
2a257b7 Merge pull request spotify#51 from isaachier/master
3c04013 Suppress issue in clang analyzer.
678cef3 Merge pull request spotify#50 from isaachier/master
a131c65 Remove unused CMake file.
5664746 Merge pull request spotify#47 from AKindyakov/case_insensibility_for_special
8140713 Remove unnecessary INSTALL_INTERFACE expression.
e13e72e Use template for CMake installation.
aa2df66 Fix mistake for build interface include dir.
8e02bf4 Improve CMake changes.
a711666 Update CMake package generation.
9972d3c Implement ALLOW_CASE_INSENSIBILITY mode for StringToDoubleConverter class
23cac04 Update Changelog.
ca220cb Update Changelog.
7f54e48 Merge branch 'avoid_negative_shift'
4abe326 Avoid negative shift. (spotify#42)
78cd7b1 Add assert and test.
1921cb3 Avoid negative shift.
d8d4e66 Merge pull request spotify#39 from uburuntu/master
48b5e70 Fix previous fix
12c0a23 cctest: fix possible null pointer dereference
617af29 Add const qualifiers where it possible
bb8e225 ieee: remove extra qualification Double::
79fb300 Merge pull request spotify#38 from sorear/add-riscv
8316ed5 Add support for RISC-V
d4d68e4 Merge pull request spotify#37 from KindDragon/patch-1
d7f9404 Update and rename README to README.md

git-subtree-dir: vendor/double-conversion
git-subtree-split: 5cc233e98b74c5c370de888198a2b35200d55468
  • Loading branch information
parbo committed Oct 17, 2019
1 parent d6e2c10 commit 353fb87
Show file tree
Hide file tree
Showing 44 changed files with 3,668 additions and 1,945 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.sconsign.dblite
*~
*.o
*.obj
msvc/Release/
Expand All @@ -7,3 +8,22 @@ msvc/Debug/
*.opensdf
*.sdf
*.user
*.a
*.so
*.so.*
*.dylib
/run_tests
Makefile
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
*.cmake
*.kdev4
DartConfiguration.tcl
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Mike Hommey <[email protected]>
Martin Olsson <[email protected]>
Kent Williams <[email protected]>
Elan Ruusamäe <[email protected]>
Colin Hirsch <[email protected]>
Zhenyi Peng <[email protected]>
2 changes: 2 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

licenses(["notice"])

exports_files(["LICENSE"])

cc_library(
name = "double-conversion",
srcs = [
Expand Down
160 changes: 102 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
cmake_minimum_required(VERSION 2.8.12)
project(double-conversion)
cmake_minimum_required(VERSION 3.0)
project(double-conversion VERSION 3.1.5)

include(GNUInstallDirs)
set(headers
double-conversion/bignum.h
double-conversion/cached-powers.h
double-conversion/diy-fp.h
double-conversion/double-conversion.h
double-conversion/double-to-string.h
double-conversion/fast-dtoa.h
double-conversion/fixed-dtoa.h
double-conversion/ieee.h
double-conversion/string-to-double.h
double-conversion/strtod.h
double-conversion/utils.h)

# pick a version #
set(double-conversion_VERSION 2.0.1)
set(double-conversion_SOVERSION_MAJOR 1)
set(double-conversion_SOVERSION_MINOR 0)
set(double-conversion_SOVERSION_PATCH 0)
set(double-conversion_SOVERSION
${double-conversion_SOVERSION_MAJOR}.${double-conversion_SOVERSION_MINOR}.${double-conversion_SOVERSION_PATCH})

# set suffix for CMake files used for packaging
if(WIN32 AND NOT CYGWIN)
set(INSTALL_CMAKE_DIR CMake)
else()
set(INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/double-conversion)
endif()
add_library(double-conversion
double-conversion/bignum.cc
double-conversion/bignum-dtoa.cc
double-conversion/cached-powers.cc
double-conversion/double-to-string.cc
double-conversion/fast-dtoa.cc
double-conversion/fixed-dtoa.cc
double-conversion/string-to-double.cc
double-conversion/strtod.cc
${headers})
target_include_directories(
double-conversion PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

# Add src subdirectory
add_subdirectory(double-conversion)
# pick a version #
set_target_properties(double-conversion PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 3)

#
# set up testing if requested
option(BUILD_TESTING "Build test programs" OFF)
if(BUILD_TESTING)
Expand All @@ -30,41 +39,76 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()

#
# mention the library target as export library
export(TARGETS double-conversion
FILE "${PROJECT_BINARY_DIR}/double-conversionLibraryDepends.cmake")

#
# set this build as an importable package
export(PACKAGE double-conversion)

#
# make a cmake file -- in this case, all that needs defining
# is double-conversion_INCLUDE_DIRS
configure_file(double-conversionBuildTreeSettings.cmake.in
"${PROJECT_BINARY_DIR}/double-conversionBuildTreeSettings.cmake"
@ONLY)

#
# sets up config to be used by CMake find_package
configure_file(double-conversionConfig.cmake.in
"${PROJECT_BINARY_DIR}/double-conversionConfig.cmake"
@ONLY)
#
# Export version # checked by find_package
configure_file(double-conversionConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/double-conversionConfigVersion.cmake"
@ONLY)
#
# install config files for find_package
install(FILES
"${PROJECT_BINARY_DIR}/double-conversionConfig.cmake"
"${PROJECT_BINARY_DIR}/double-conversionConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)


#
# generates install cmake files to find libraries in installation.
install(EXPORT double-conversionLibraryDepends DESTINATION
"${INSTALL_CMAKE_DIR}" COMPONENT dev)
####
# Installation (https://github.com/forexample/package-example)

include(GNUInstallDirs)

# Layout. This works for all platforms:
# * <prefix>/lib/cmake/<PROJECT-NAME>
# * <prefix>/lib/
# * <prefix>/include/
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")

set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")

# Configuration
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
set(targets_export_name "${PROJECT_NAME}Targets")
set(namespace "${PROJECT_NAME}::")

# Include module with function 'write_basic_package_version_file'
include(CMakePackageConfigHelpers)

# Configure '<PROJECT-NAME>ConfigVersion.cmake'
# Note: PROJECT_VERSION is used as a VERSION
write_basic_package_version_file(
"${version_config}" COMPATIBILITY SameMajorVersion
)

# Configure '<PROJECT-NAME>Config.cmake'
# Use variables:
# * targets_export_name
# * PROJECT_NAME
configure_package_config_file(
"cmake/Config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${config_install_dir}"
)

# Targets:
# * <prefix>/lib/libdouble-conversion.a
# * header location after install: <prefix>/include/double-conversion/*.h
# * headers can be included by C++ code `#include <double-conversion/*.h>`
install(
TARGETS double-conversion
EXPORT "${targets_export_name}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

# Headers:
# * double-conversion/*.h -> <prefix>/include/double-conversion/*.h
install(
FILES ${headers}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/double-conversion"
)

# Config
# * <prefix>/lib/cmake/double-conversion/double-conversionConfig.cmake
# * <prefix>/lib/cmake/double-conversion/double-conversionConfigVersion.cmake
install(
FILES "${project_config}" "${version_config}"
DESTINATION "${config_install_dir}"
)

# Config
# * <prefix>/lib/cmake/double-conversion/double-conversionTargets.cmake
install(
EXPORT "${targets_export_name}"
NAMESPACE "${namespace}"
DESTINATION "${config_install_dir}"
)
93 changes: 93 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
2019-10-12:
Really add support for microblaze. A previous commit was lacking
the necessary line.

2019-09-02:
Add support for e2k architectur. Thanks to Michael Shigorin.

2019-08-01:
Add min exponent width option in double-to-string conversion.

2019-06-22:
Remove redundant parenthesis.

2019-06-11:
Changed all macros to use DOUBLE_CONVERSION_ as prefix.
Renamed ALLOW_CASE_INSENSIBILITY to ALLOW_CASE_INSENSITIVITY,
the old name is still available but officially deprecated.
Created and exposed new intermediate function StrtodTrimmed().

2019-05-25:
Fix `0x` for string->double conversion when Hex Floats are allowed.
Avoid integer overflow when exponents for hex floats were too big.
Update version number.

2019-04-22:
Fixed warning in gcc4.9. Thanks to Scott McCaskill
(https://github.com/usefulcat) for the patch.

2019-04-16:
Merged changes to install libraries in the correct place when
using 64-bit libraries.
Contributed by Jason Zaman <[email protected]> and (independently)
Dan Church (https://github.com/h3xx)

2019-03-11:
Use relative includes in the library. This shouldn't have any visible effect
for consumers of the library.

Update version number.

2019-03-06:
Fix typo in test.
Update version number.

2019-03-03:
Fix separator characters when they they don't fit into 8 bits.
Update version number.

2019-02-16:
Check correctly for _MSC_VER.
Patch by Ben Boeckel

2019-01-17:
Allow the library to be compiled for Emscripten.
Patch by Tim Paine.

2018-09-15:
Update version numbers. This also updates the shared-library version number.

2018-09-09:
Fix bug where large hex literals would lose their minus sign.
Added support for separator characters (which adds a new optional
argument). Thus increasing the version number to 3.1.0
Added support for hexadecimal float literals.
Support for more architectures.

2017-12-06:
Renamed `DISALLOW_COPY_AND_ASSIGN` and `DISALLOW_IMPLICIT_CONSTRUCTORS`
macros to `DC_DISALLOW_COPY_AND_ASSIGN` and
`DC_DISALLOW_IMPLICIT_CONSTRUCTORS` to make it easier to integrate the
library with other libraries that have similar macros.

2017-08-05:
Tagged v3.0.0.
Due to the directory rename switching to a new version number.
The API for the library itself hasn't changed.

2017-03-04:
Avoid negative shift. Fixes #41.

2016-11-17:
Support RISC-V.


2016-09-10:
Add fPIC flag on x86_64 if the compiler supports it. Fixes #34.

2015 and 2016:
Lots of improvements to the build system.

2015:
Warning fixes.

2015-05-19:
Rename 'src' directory to 'double-conversion'.

Expand Down
13 changes: 7 additions & 6 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/google/double-conversion/
https://github.com/google/double-conversion

This project (double-conversion) provides binary-decimal and decimal-binary
routines for IEEE doubles.
Expand All @@ -7,14 +7,15 @@ The library consists of efficient conversion routines that have been extracted
from the V8 JavaScript engine. The code has been refactored and improved so that
it can be used more easily in other projects.

There is extensive documentation in double-conversion/double-conversion.h. Other
examples can be found in test/cctest/test-conversions.cc.
There is extensive documentation in `double-conversion/string-to-double.h` and
`double-conversion/double-to-string.h`. Other examples can be found in
`test/cctest/test-conversions.cc`.


Building
========

This library can be built with scons [0] or cmake [1].
This library can be built with [scons][0] or [cmake][1].
The checked-in Makefile simply forwards to scons, and provides a
shortcut to run all tests:

Expand Down Expand Up @@ -50,5 +51,5 @@ Use `-DBUILD_TESTING=ON` to build the test executable.
make
test/cctest/cctest --list | tr -d '<' | xargs test/cctest/cctest

[0]: http://www.scons.org
[1]: http://www.cmake.org
[0]: http://www.scons.org/
[1]: https://cmake.org/
6 changes: 3 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ optimize = ARGUMENTS.get('optimize', 0)
env.Replace(CXX = ARGUMENTS.get('CXX', 'g++'))

# for shared lib, requires scons 2.3.0
env['SHLIBVERSION'] = '1.0.0'
env['SHLIBVERSION'] = '3.0.0'

CCFLAGS = []
if int(debug):
CCFLAGS.append(ARGUMENTS.get('CXXFLAGS', '-g -Wall -Wshadow -Werror'))
CCFLAGS.append(ARGUMENTS.get('CXXFLAGS', '-g -Wall -Wshadow -Werror -UNDEBUG'))
if int(optimize):
CCFLAGS.append(ARGUMENTS.get('CXXFLAGS', '-O3'))
CCFLAGS.append(ARGUMENTS.get('CXXFLAGS', '-O3 -DNDEBUG=1'))

env.Append(CCFLAGS = " ".join(CCFLAGS))

Expand Down
4 changes: 4 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")
1 change: 1 addition & 0 deletions double-conversion/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.os
Loading

0 comments on commit 353fb87

Please sign in to comment.