summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-10-15 15:40:26 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-11-02 17:00:50 +0000
commit8c2ca33073f20e1fe552bd8b5f663aec5b8a634d (patch)
treea8277e71b865e3e08908a4937668e163c35a03e6 /tools
parent84042523f272c1d30247e9329eea21036ff793f4 (diff)
Replace qdtoa and qstrtod implementation by a 3rdparty library
This also fixes the underlying cause of QTBUG-44039 and QTBUG-43885. You can choose between system, qt, and no libdouble-conversion support. If you choose "no", snprintf_l and sscanf_l will be used. By default, system double conversion is used if the system provides a double-conversion library. Otherwise the bundled libdouble-conversion is built. sscanf_l and snprintf_l are not used by default as the planned "shortest" conversion mode to produce the shortest possible string will give less precise results when implemented with snprintf_l. Change-Id: I8ca08a0fca5c54cf7009e48e771385614f6aa031 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/configureapp.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 8524795dbf..08afc51bc4 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -262,6 +262,7 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
dictionary[ "PNG" ] = "auto";
dictionary[ "LIBJPEG" ] = "auto";
dictionary[ "LIBPNG" ] = "auto";
+ dictionary[ "DOUBLECONVERSION" ] = "auto";
dictionary[ "FREETYPE" ] = "yes";
dictionary[ "HARFBUZZ" ] = "qt";
@@ -627,6 +628,14 @@ void Configure::parseCmdLine()
dictionary[ "LIBPNG" ] = "system";
}
+ // Double Conversion -----------------------------------------
+ else if (configCmdLine.at(i) == "-no-doubleconversion")
+ dictionary[ "DOUBLECONVERSION" ] = "no";
+ else if (configCmdLine.at(i) == "-qt-doubleconversion")
+ dictionary[ "DOUBLECONVERSION" ] = "qt";
+ else if (configCmdLine.at(i) == "-system-doubleconversion")
+ dictionary[ "DOUBLECONVERSION" ] = "system";
+
// Text Rendering --------------------------------------------
else if (configCmdLine.at(i) == "-no-freetype")
dictionary[ "FREETYPE" ] = "no";
@@ -1959,6 +1968,10 @@ bool Configure::displayHelp()
desc("LIBJPEG", "qt", "-qt-libjpeg", "Use the libjpeg bundled with Qt.");
desc("LIBJPEG", "system","-system-libjpeg", "Use libjpeg from the operating system.\nSee http://www.ijg.org\n");
+ desc("DOUBLECONVERSION", "no", "-no-doubleconversion", "Use sscanf_l and snprintf_l for (imprecise) double conversion.");
+ desc("DOUBLECONVERSION", "qt", "-qt-doubleconversion", "Use the libdouble-conversion bundled with Qt.");
+ desc("DOUBLECONVERSION", "system", "-system-doubleconversion", "Use the libdouble-conversion provided by the system.");
+
desc("FREETYPE", "no", "-no-freetype", "Do not compile in Freetype2 support.");
desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt.");
desc("FREETYPE", "system","-system-freetype", "Use the libfreetype provided by the system.");
@@ -2369,6 +2382,8 @@ bool Configure::checkAvailability(const QString &part)
available = dictionary["QT_CPU_FEATURES"].contains("neon");
} else if (part == "FONT_CONFIG") {
available = tryCompileProject("unix/fontconfig");
+ } else if (part == "DOUBLECONVERSION") {
+ available = tryCompileProject("unix/doubleconversion");
}
return available;
@@ -2585,6 +2600,9 @@ void Configure::autoDetection()
if (dictionary["FONT_CONFIG"] == "auto")
dictionary["FONT_CONFIG"] = checkAvailability("FONT_CONFIG") ? "yes" : "no";
+ if (dictionary["DOUBLECONVERSION"] == "auto")
+ dictionary["DOUBLECONVERSION"] = checkAvailability("DOUBLECONVERSION") ? "system" : "qt";
+
if (dictionary["DIRECTWRITE"] == "auto")
dictionary["DIRECTWRITE"] = checkAvailability("DIRECTWRITE") ? "yes" : "no";
@@ -2833,6 +2851,14 @@ void Configure::generateOutputVars()
if (dictionary[ "LIBPNG" ] == "system")
qtConfig += "system-png";
+ // Double conversion -----------------------------------------------
+ if (dictionary[ "DOUBLECONVERSION" ] == "qt")
+ qtConfig += "doubleconversion";
+ else if (dictionary[ "DOUBLECONVERSION" ] == "system")
+ qtConfig += "system-doubleconversion";
+ else if (dictionary[ "DOUBLECONVERSION" ] == "no")
+ qtConfig += "no-doubleconversion";
+
// Text rendering --------------------------------------------------
if (dictionary[ "FREETYPE" ] == "yes")
qtConfig += "freetype";
@@ -3911,6 +3937,7 @@ void Configure::displayConfig()
sout << " GIF support............." << dictionary[ "GIF" ] << endl;
sout << " JPEG support............" << dictionary[ "JPEG" ] << endl;
sout << " PNG support............." << dictionary[ "PNG" ] << endl;
+ sout << " DoubleConversion........" << dictionary[ "DOUBLECONVERSION" ] << endl;
sout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl;
sout << " Fontconfig support......" << dictionary[ "FONT_CONFIG" ] << endl;
sout << " HarfBuzz support........" << dictionary[ "HARFBUZZ" ] << endl;