Skip to content

Commit

Permalink
Guard on DEBUG_NEW and stub-out for precompiled headers
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Oct 2, 2016
1 parent 8a6d188 commit fd278c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions algparam.h
Expand Up @@ -459,7 +459,7 @@ class AlgorithmParametersTemplate : public AlgorithmParametersBase
}
}

#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#if defined(DEBUG_NEW) && (_MSC_VER >= 1300)
# pragma push_macro("new")
# undef new
#endif
Expand All @@ -470,7 +470,7 @@ class AlgorithmParametersTemplate : public AlgorithmParametersBase
CRYPTOPP_UNUSED(p); // silence warning
}

#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#if defined(DEBUG_NEW) && (_MSC_VER >= 1300)
# pragma pop_macro("new")
#endif

Expand Down
6 changes: 6 additions & 0 deletions pch.h
Expand Up @@ -21,4 +21,10 @@
#endif
# endif

// Enable file and line numbers, if available.
// #if defined(_MSC_VER) && defined(_DEBUG) && defined(USE_PRECOMPILED_HEADERS)
// # define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
// # define new DEBUG_NEW
// #endif

#endif // CRYPTOPP_PCH_H

1 comment on commit fd278c2

@noloader
Copy link
Collaborator Author

@noloader noloader commented on fd278c2 Oct 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the symptom:

1>...\cryptopp\algparam.h(322): error C2061: syntax error : identifier 'buffer'
1>          d:\work\app\tools\cryptopp\algparam.h(321) : while compiling class template member function
1>              'void CryptoPP::AlgorithmParametersTemplate<T>::MoveInto(void *) const'
1>          with
1>          [
1>              T=bool
1>          ]
1>          d:\work\app\tools\cryptopp\algparam.h(329) : see reference to class template instantiation 
1>              'CryptoPP::AlgorithmParametersTemplate<T>' being compiled
1>          with
1>          [
1>              T=bool
1>          ]

Please sign in to comment.