Skip to content

Commit bd8204a

Browse files
Using blackbox-functionality to check whther type was already loaded
1 parent e87d402 commit bd8204a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Singular/countedref.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,10 @@ BOOLEAN countedref_deserialize(blackbox **b, void **d, si_link f)
695695

696696
void countedref_reference_load()
697697
{
698+
int tok;
699+
if (blackboxIsCmd("reference", tok) == ROOT_DECL)
700+
return;
701+
698702
blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox));
699703
bbx->blackbox_CheckAssign = countedref_CheckAssign;
700704
bbx->blackbox_destroy = countedref_destroy;
@@ -715,6 +719,10 @@ void countedref_reference_load()
715719

716720
void countedref_shared_load()
717721
{
722+
int tok;
723+
if (blackboxIsCmd("shared", tok) == ROOT_DECL)
724+
return;
725+
718726
blackbox *bbxshared = (blackbox*)omAlloc0(sizeof(blackbox));
719727
bbxshared->blackbox_String = countedref_String;
720728
bbxshared->blackbox_Print = countedref_Print;

0 commit comments

Comments
 (0)