Browse Source

Allow SWIG access to lset

SWIG doesn't like initializer lists because they are compile-time
objects

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19326
pcb_db
Seth Hillbrand 10 months ago
parent
commit
c2bfdaa6ae
  1. 10
      common/lset.cpp
  2. 2
      include/lset.h

10
common/lset.cpp

@ -51,6 +51,16 @@ LSET::LSET( std::initializer_list<PCB_LAYER_ID> aList ) :
}
}
LSET::LSET( const std::vector<PCB_LAYER_ID>& aList ) :
LSET()
{
for( PCB_LAYER_ID layer : aList )
{
if( layer >= 0 )
set( layer );
}
}
LSET::LSET( const LSEQ& aSeq ) :
LSET()

2
include/lset.h

@ -45,6 +45,8 @@ public:
LSET( std::initializer_list<PCB_LAYER_ID> aList );
LSET( const std::vector<PCB_LAYER_ID>& aList );
LSET( const LSEQ& aSeq );
LSET( const LAYER_RANGE& aRange );

Loading…
Cancel
Save