config_ns.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // config_ns.h - written and placed in public domain by Jeffrey Walton
  2. // the bits that make up this source file are from the
  3. // library's monolithic config.h.
  4. /// \file config_ns.h
  5. /// \brief Library configuration file
  6. /// \details <tt>config_ns.h</tt> provides defines for C++ and library
  7. /// namespaces.
  8. /// \details <tt>config.h</tt> was split into components in May 2019 to better
  9. /// integrate with Autoconf and its feature tests. The splitting occurred so
  10. /// users could continue to include <tt>config.h</tt> while allowing Autoconf
  11. /// to write new <tt>config_asm.h</tt> and new <tt>config_cxx.h</tt> using
  12. /// its feature tests.
  13. /// \note You should include <tt>config.h</tt> rather than <tt>config_ns.h</tt>
  14. /// directly.
  15. /// \sa <A HREF="https://github.com/weidai11/cryptopp/issues/835">Issue 835,
  16. /// Make config.h more autoconf friendly</A>,
  17. /// <A HREF="https://www.cryptopp.com/wiki/Configure.sh">Configure.sh script</A>
  18. /// on the Crypto++ wiki
  19. /// \since Crypto++ 8.3
  20. #ifndef CRYPTOPP_CONFIG_NAMESPACE_H
  21. #define CRYPTOPP_CONFIG_NAMESPACE_H
  22. // namespace support is now required
  23. #ifdef NO_NAMESPACE
  24. # error namespace support is now required
  25. #endif
  26. #ifdef CRYPTOPP_DOXYGEN_PROCESSING
  27. /// \namespace CryptoPP
  28. /// \brief Crypto++ library namespace
  29. /// \details Nearly all classes are located in the CryptoPP namespace. Within
  30. /// the namespace, there are four additional namespaces.
  31. /// <ul>
  32. /// <li>Name - namespace for names used with NameValuePairs and documented
  33. /// in argnames.h
  34. /// <li>NaCl - namespace for NaCl test functions like crypto_box,
  35. /// crypto_box_open, crypto_sign, and crypto_sign_open
  36. /// <li>Donna - namespace for curve25519 library operations. The name was
  37. /// selected due to use of Langley and Moon's curve25519-donna.
  38. /// <li>Test - namespace for testing and benchmarks classes
  39. /// <li>Weak - namespace for weak and wounded algorithms, like ARC4, MD5
  40. /// and Pananma
  41. /// </ul>
  42. /// \since Crypto++ 3.0
  43. namespace CryptoPP { }
  44. // Bring in the symbols found in the weak namespace; and fold Weak1 into Weak
  45. #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
  46. #define Weak1 Weak
  47. // Avoid putting "CryptoPP::" in front of everything in Doxygen output
  48. #define CryptoPP
  49. #define NAMESPACE_BEGIN(x)
  50. #define NAMESPACE_END
  51. // Get Doxygen to generate better documentation for these typedefs
  52. #define DOCUMENTED_TYPEDEF(x, y) class y : public x {}
  53. // Make "protected" "private" so the functions and members are not documented
  54. #define protected private
  55. #else
  56. // Not Doxygen
  57. #define NAMESPACE_BEGIN(x) namespace x {
  58. #define NAMESPACE_END }
  59. #define DOCUMENTED_TYPEDEF(x, y) typedef x y
  60. #endif // CRYPTOPP_DOXYGEN_PROCESSING
  61. #define ANONYMOUS_NAMESPACE_BEGIN namespace {
  62. #define ANONYMOUS_NAMESPACE_END }
  63. #define USING_NAMESPACE(x) using namespace x;
  64. #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
  65. #define DOCUMENTED_NAMESPACE_END }
  66. #endif // CRYPTOPP_CONFIG_NAMESPACE_H