Skip to content

Commit 4207a46

Browse files
committed
fix MSVC link error for NilSTEPentity
1 parent 7316fe5 commit 4207a46

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

src/cldai/sdaiApplication_instance_set.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include <math.h>
3232
#include "sc_memmgr.h"
3333

34+
#include "sdaiApplication_instance.h"
35+
3436
// to help ObjectCenter
3537
#ifndef HAVE_MEMMOVE
3638
extern "C"

src/cllazyfile/lazyInstMgr.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include "instMgrHelper.h"
77
#include "lazyRefs.h"
88

9+
#include "sdaiApplication_instance.h"
10+
911
lazyInstMgr::lazyInstMgr() {
1012
_headerRegistry = new Registry( HeaderSchemaInit );
1113
_instanceTypes = new instanceTypes_t( 255 ); //NOTE arbitrary max of 255 chars for a type name
@@ -137,7 +139,7 @@ SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id, bool reSee
137139
std::cerr << "Instance #" << id << " exists in multiple sections. This is not yet supported." << std::endl;
138140
break;
139141
}
140-
if( ( inst ) && ( inst != & NilSTEPentity ) ) {
142+
if( !isNilSTEPentity( inst ) ) {
141143
_instancesLoaded.insert( id, inst );
142144
_loadedInstanceCount++;
143145
lazyRefs lr( this, inst );

src/cllazyfile/sectionReader.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ SDAI_Application_instance * sectionReader::getRealInstance( const Registry * reg
302302
inst = reg->ObjCreate( tName, sName );
303303
break;
304304
}
305-
306-
if( inst != & NilSTEPentity ) {
305+
if( !isNilSTEPentity( inst ) ) {
307306
if( !comment.empty() ) {
308307
inst->AddP21Comment( comment );
309308
}

src/clstepcore/sdaiApplication_instance.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424

2525
SDAI_Application_instance NilSTEPentity;
2626

27+
bool isNilSTEPentity( const SDAI_Application_instance * ai ) {
28+
if( ai && ai == &NilSTEPentity ) {
29+
return true;
30+
}
31+
return false;
32+
}
33+
2734
/**************************************************************//**
2835
** \file sdaiApplication_instance.cc Functions for manipulating entities
2936
**

src/clstepcore/sdaiApplication_instance.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,6 @@ class SC_CORE_EXPORT SDAI_Application_instance : public SDAI_DAObject_SDAI {
196196
// current style of CORBA handles for Part 23 - NOTE - used for more than CORBA
197197
typedef SDAI_Application_instance * SDAI_Application_instance_ptr;
198198
typedef SDAI_Application_instance_ptr SDAI_Application_instance_var;
199+
SC_CORE_EXPORT bool isNilSTEPentity( const SDAI_Application_instance * ai );
199200

200201
#endif //STEPENTITY_H

0 commit comments

Comments
 (0)