From dc310e6377bcebbfd593714099487d066fabc724 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Thu, 5 Aug 2010 21:53:47 +0000 Subject: Add an #if to modp_b64_data.h to avoid a typedef conflict that certain finicky compilers (in particular, nacl-g++) complain about. Contributed by mdsteele@google.com BUG=none TEST=Try to compile modp_b64 with nacl-g++ Review URL: http://codereview.chromium.org/3044045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55137 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/modp_b64/README.chromium | 10 ++++++---- third_party/modp_b64/modp_b64_data.h | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'third_party/modp_b64') diff --git a/third_party/modp_b64/README.chromium b/third_party/modp_b64/README.chromium index 4b22d61..fc30450 100644 --- a/third_party/modp_b64/README.chromium +++ b/third_party/modp_b64/README.chromium @@ -8,7 +8,9 @@ and to fix compilation errors that occur under VC8. The file was renamed modp_b64.cc to force it to be compiled as C++ so that the inclusion of basictypes.h could be possible. -The file modp_b64_data.h was generated by modp_b64_gen.c (under Linux), which -is not included in this directory. The resulting header was modified to remove -the "#include " since that header file does not exist under VC8. The -required typedefs for uint8_t and uint32_t were defined in its place. +The file modp_b64_data.h was generated by modp_b64_gen.c (under Linux), +which is not included in this directory. The resulting header was +modified to not include when COMPILER_MSVC is defined (since +that header file does not exist under VC8), but instead in that case to +include "base/basictypes.h" and provide the required typedefs for +uint8_t and uint32_t using uint8 and uint32. diff --git a/third_party/modp_b64/modp_b64_data.h b/third_party/modp_b64/modp_b64_data.h index a2dc7dd..aca6f0f 100644 --- a/third_party/modp_b64/modp_b64_data.h +++ b/third_party/modp_b64/modp_b64_data.h @@ -1,6 +1,14 @@ +#include "build/build_config.h" +#if !defined(COMPILER_MSVC) +#include +#else +// VC8 doesn't have stdint.h. On the other hand, some compilers don't like +// the below code, because basictypes.h itself includes stdint.h and the +// typedefs below can cause conflicts. #include "base/basictypes.h" typedef uint8 uint8_t; typedef uint32 uint32_t; +#endif #define CHAR62 '+' #define CHAR63 '/' -- cgit v1.1