Skip to content

Commit 958ca10

Browse files
committedJun 23, 2017
[sipify] Add support for specifying VirtualErrorHandlers to use for a function
1 parent d63d560 commit 958ca10

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎scripts/sipify.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ sub fix_annotations {
223223
$line =~ s/\bSIP_TRANSFERTHIS\b/\/TransferThis\//;
224224

225225
$line =~ s/SIP_PYNAME\(\s*(\w+)\s*\)/\/PyName=$1\//;
226+
$line =~ s/SIP_VIRTUALERRORHANDLER\(\s*(\w+)\s*\)/\/VirtualErrorHandler=$1\//;
226227

227228
# combine multiple annotations
228229
# https://regex101.com/r/uvCt4M/3
@@ -316,14 +317,14 @@ sub detect_comment_block{
316317
}
317318

318319
# do not process SIP code %XXXCode
319-
if ( $SIP_RUN == 1 && $LINE =~ m/^ *% *(MappedType|Type(?:Header)?Code|Module(?:Header)?Code|Convert(?:From|To)(?:Type|SubClass)Code|MethodCode)(.*)?$/ ){
320+
if ( $SIP_RUN == 1 && $LINE =~ m/^ *% *(VirtualErrorHandler|MappedType|Type(?:Header)?Code|Module(?:Header)?Code|Convert(?:From|To)(?:Type|SubClass)Code|MethodCode)(.*)?$/ ){
320321
$LINE = "%$1$2";
321322
$COMMENT = '';
322323
dbg_info("do not process SIP code");
323324
while ( $LINE !~ m/^ *% *End/ ){
324325
write_output("COD", $LINE."\n");
325326
$LINE = read_line();
326-
$LINE =~ s/^ *% *(MappedType|Type(?:Header)?Code|Module(?:Header)?Code|Convert(?:From|To)(?:Type|SubClass)Code|MethodCode)(.*)?$/%$1$2/;
327+
$LINE =~ s/^ *% *(VirtualErrorHandler|MappedType|Type(?:Header)?Code|Module(?:Header)?Code|Convert(?:From|To)(?:Type|SubClass)Code|MethodCode)(.*)?$/%$1$2/;
327328
$LINE =~ s/^\s*SIP_END(.*)$/%End$1/;
328329
}
329330
$LINE =~ s/^\s*% End/%End/;

‎src/core/qgis_sip.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@
152152
*/
153153
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
154154

155+
/*
156+
* Virtual error handler (/VirtualErrorHandler/)
157+
*/
158+
#define SIP_VIRTUALERRORHANDLER(name)
159+
155160
/*
156161
* Will insert a `%End` directive in sip files
157162
*/

0 commit comments

Comments
 (0)