diff options
author | Jason E. Hale <jhale@FreeBSD.org> | 2018-08-24 17:22:01 +0000 |
---|---|---|
committer | Jason E. Hale <jhale@FreeBSD.org> | 2018-08-24 17:22:01 +0000 |
commit | edf512ca2e5e5a59e84993103663d499dc54600d (patch) | |
tree | 755180fd4810fbf33aa78186166afc94eafc7a8e /security/cryptopp/files/patch-misc.h | |
parent | Update to 0.9.1 (diff) |
Update security/cryptopp to 7.0.0
We now install a pkgconfig file which will allow ports to check whether
cryptopp was built with assembly instructions enabled or not. There are
a few functions that will be undefined if built without assembly and
-DCRYPTOPP_DISABLE_ASM needs to be passed to the compiler in that case
to avoid build failures. This is not new, but the pkgconf file should
make it easier to determine if the flag is needed or not.
Fix several ports due to API changes and to use the new pkgconf file
to determine cryptopp location and build flags. Special cases below.
deskutils/cdcat
- Use cryptopp shared library instead of static, detect with pkgconf
devel/xeus
- Fix dependencies and remove header-only libraries from RUN_DEPENDS
- Rework to use the cryptopp pkgconf file
- net/cppzmq CMake files were fixed in r477649, remove hacks for that
as they were seemingly causing devel/xeus-cling to link to cryptopp
unnecessarily
- Remove C++17 code from cryptopp checks for compatibility
devel/xeus-cling
- Fix dependencies
- Remove hacks for previously broken cppzmq CMake files and no longer
needed cryptopp dependency
Changes: https://www.cryptopp.com/#news
PR: 230579 (original patch, not used)
Submitted by: yuri
Notes
Notes:
svn path=/head/; revision=477967
Diffstat (limited to 'security/cryptopp/files/patch-misc.h')
-rw-r--r-- | security/cryptopp/files/patch-misc.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/security/cryptopp/files/patch-misc.h b/security/cryptopp/files/patch-misc.h index 8b966dd471be..194061634cb6 100644 --- a/security/cryptopp/files/patch-misc.h +++ b/security/cryptopp/files/patch-misc.h @@ -2,12 +2,12 @@ This fixes a warning triggered by testing an unsigned parameter against 0. The patch solves this by creating a different template for signed case. (PR: 178827) ---- misc.h.orig 2016-10-10 23:49:54 UTC +--- misc.h.orig 2018-04-08 08:47:11 UTC +++ misc.h -@@ -529,8 +529,10 @@ inline bool SafeConvert(T1 from, T2 &to) - //! \param value the value to convert - //! \param base the base to use during the conversion - //! \returns the string representation of value in base. +@@ -572,8 +572,10 @@ inline bool SafeConvert(T1 from, T2 &to) + /// \param value the value to convert + /// \param base the base to use during the conversion + /// \returns the string representation of value in base. +template<bool> struct IsUnsigned {}; + template <class T> @@ -16,7 +16,7 @@ for signed case. (PR: 178827) { // Hack... set the high bit for uppercase. static const unsigned int HIGH_BIT = (1U << 31); -@@ -541,12 +543,6 @@ std::string IntToString(T value, unsigne +@@ -584,12 +586,6 @@ std::string IntToString(T value, unsigned int base = 1 if (value == 0) return "0"; @@ -29,7 +29,7 @@ for signed case. (PR: 178827) std::string result; while (value > 0) { -@@ -554,11 +550,30 @@ std::string IntToString(T value, unsigne +@@ -597,9 +593,28 @@ std::string IntToString(T value, unsigned int base = 1 result = char((digit < 10 ? '0' : (CH - 10)) + digit) + result; value /= base; } @@ -49,14 +49,12 @@ for signed case. (PR: 178827) if (negate) result = "-" + result; return result; - } - ++} ++ +template <class T> +std::string IntToString(T value, unsigned int base = 10) +{ + return IntToStringImpl(value, base, IsUnsigned<(static_cast<T>(-1) > 0)>()); -+} -+ - //! \brief Converts an unsigned value to a string - //! \param value the value to convert - //! \param base the base to use during the conversion + } + + /// \brief Converts an unsigned value to a string |