summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorcmasone@chromium.org <cmasone@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-03 01:42:00 +0000
committercmasone@chromium.org <cmasone@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-03 01:42:00 +0000
commita3d727da44c81a4746d978580402ea319f75b3f4 (patch)
treea489741af69c8b3d3a401097acd59dd5603e8349 /third_party
parentf9019858c3d6471e0bc665c12fe83864d08c3029 (diff)
downloadchromium_src-a3d727da44c81a4746d978580402ea319f75b3f4.zip
chromium_src-a3d727da44c81a4746d978580402ea319f75b3f4.tar.gz
chromium_src-a3d727da44c81a4746d978580402ea319f75b3f4.tar.bz2
[libphonenumber] snprintf isn't generally in the std:: namespace
Due to some relatively common gnu-isms, one can often use snprintf by calling std::snprintf. It's not necessarily proper to do so, though, and the ARM toolchain used on Chromium OS does not support it. BUG=None TEST=unit tests R=georgey Review URL: http://codereview.chromium.org/7277083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/libphonenumber/README.chromium4
-rw-r--r--third_party/libphonenumber/cpp/src/default_logger.h4
-rw-r--r--third_party/libphonenumber/patches/version277a.patch21
3 files changed, 26 insertions, 3 deletions
diff --git a/third_party/libphonenumber/README.chromium b/third_party/libphonenumber/README.chromium
index bd01490..e662452 100644
--- a/third_party/libphonenumber/README.chromium
+++ b/third_party/libphonenumber/README.chromium
@@ -18,8 +18,8 @@ Additional files, not in the original library:
libphonenumber.gyp
README.chromium
-Until the changes are upstreamed library is included directly, with a patch
-in patches/version277.patch applied.
+Until the changes are upstreamed library is included directly, with patches
+in patches/version277.patch and patches/version277a.patch applied.
The folders included in our repository for now are
cpp/
diff --git a/third_party/libphonenumber/cpp/src/default_logger.h b/third_party/libphonenumber/cpp/src/default_logger.h
index 70ee2f5..7afee68 100644
--- a/third_party/libphonenumber/cpp/src/default_logger.h
+++ b/third_party/libphonenumber/cpp/src/default_logger.h
@@ -17,6 +17,8 @@
#ifndef I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
#define I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
+#include <stdio.h>
+
#include <string>
#include "logger.h"
@@ -48,7 +50,7 @@ struct ConvertToString<int> {
#if defined(OS_WIN)
_itoa_s(n, buffer, sizeof(buffer), 10);
#else
- std::snprintf(buffer, sizeof(buffer), "%d", n);
+ snprintf(buffer, sizeof(buffer), "%d", n);
#endif
return string(buffer);
}
diff --git a/third_party/libphonenumber/patches/version277a.patch b/third_party/libphonenumber/patches/version277a.patch
new file mode 100644
index 0000000..8757107
--- /dev/null
+++ b/third_party/libphonenumber/patches/version277a.patch
@@ -0,0 +1,21 @@
+diff -Naur src-orig/default_logger.h src/default_logger.h
+--- src-orig/default_logger.h 2011-07-02 16:27:58.000000000 -0700
++++ src/default_logger.h 2011-07-02 16:28:29.000000000 -0700
+@@ -17,6 +17,8 @@
+ #ifndef I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
+ #define I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
+
++#include <stdio.h>
++
+ #include <string>
+
+ #include "logger.h"
+@@ -45,7 +47,7 @@
+ struct ConvertToString<int> {
+ static inline string DoWork(const int& n) {
+ char buffer[16];
+- std::snprintf(buffer, sizeof(buffer), "%d", n);
++ snprintf(buffer, sizeof(buffer), "%d", n);
+ return string(buffer);
+ }
+ };