mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
different fix for MSVC compiler issues
This commit is contained in:
parent
1f61afa56b
commit
11dc4c8ce9
2 changed files with 6 additions and 8 deletions
|
@ -28,11 +28,10 @@ struct NewRef
|
|||
};
|
||||
|
||||
/**
|
||||
* These have to be forward-declared and known here in order for us to be able
|
||||
* cast them in the `Unref` function.
|
||||
* This has to be forward declared and known here in order for us to be able
|
||||
* cast this in the `Unref` function.
|
||||
*/
|
||||
class OpaqueVal;
|
||||
class TypeVal;
|
||||
|
||||
/**
|
||||
* An intrusive, reference counting smart pointer implementation. Much like
|
||||
|
@ -121,10 +120,9 @@ public:
|
|||
{
|
||||
if ( ptr_ )
|
||||
{
|
||||
// For some `Val` subclasses the MSVC compiler does
|
||||
// not detect them as inheriting from `zeek::Obj`,
|
||||
// so we have to do that manually.
|
||||
if constexpr ( std::is_base_of_v<Obj, T> )
|
||||
// Specializing `OpaqueVal` as MSVC compiler does not detect it
|
||||
// inheriting from `zeek::Obj` so we have to do that manually.
|
||||
if constexpr ( std::is_same_v<T, OpaqueVal> )
|
||||
Unref(reinterpret_cast<zeek::Obj*>(ptr_));
|
||||
else
|
||||
Unref(ptr_);
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
#include "zeek/IntrusivePtr.h"
|
||||
#include "zeek/Obj.h"
|
||||
#include "zeek/Traverse.h"
|
||||
#include "zeek/ZVal.h"
|
||||
#include "zeek/ZeekList.h"
|
||||
|
||||
namespace zeek
|
||||
{
|
||||
|
||||
class Val;
|
||||
union ZVal;
|
||||
class EnumVal;
|
||||
class RecordVal;
|
||||
class TableVal;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue