Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-558

Prevent MSVC compilation warnings "needs to have dll-interface"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.0
    • None
    • None

    Description

      The private data of classes do not prevent Microsoft compiler warning messages.

       

      As the private data is inaccessible by client application it should be safe to ignore the warning. This can be done using a macro 

      ```

      #if _WIN32
      #define LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(T, V) \
      __pragma( warning( push ) ) \
      __pragma( warning( disable : 4251 ) ) \
          struct T; std::unique_ptr<T> V; \
      __pragma( warning( pop ) )

      #else

      #define LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(T, V) struct T; std::unique_ptr<T> V;
      #endif /* WIN32 */

      ```

      Attachments

        Activity

          People

            Unassigned Unassigned
            swebb2066 Stephen Webb
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: