forked from apolukhin/Boost.DLL
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test from bugreport, provide compile time diagnostics for such ca…
…ses (#85) Fixes apolukhin#47
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2024 Antony Polukhin | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt | ||
// or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
// For more information, see http://www.boost.org | ||
|
||
#include <boost/dll/detail/demangling/msvc.hpp> | ||
|
||
struct CallbackInfo; | ||
|
||
#ifdef _MSC_VER | ||
typedef void(__stdcall* Callback)(CallbackInfo* pInfo); | ||
#else | ||
typedef void(*Callback)(CallbackInfo* pInfo); | ||
#endif | ||
|
||
|
||
int main() { | ||
namespace parser = boost::dll::detail::parser; | ||
boost::dll::detail::mangled_storage_impl ms; | ||
|
||
// The following case of mangling is not supported at the moment. Make | ||
// sure that we detect it on compile time. | ||
parser::is_mem_fn_with_name<int, void(*)(Callback)>("set_callback", ms) | ||
("public: void __cdecl int::set_callback(void (__cdecl*)(struct CallbackInfo * __ptr64)) __ptr64") | ||
; | ||
} | ||
|