@@ -553,6 +553,7 @@ class FORTRAN : public Language {
553
553
virtual int staticmemberfunctionHandler (Node *n);
554
554
virtual int staticmembervariableHandler (Node *n);
555
555
virtual int enumDeclaration (Node *n);
556
+ virtual int callbackfunctionHandler (Node *n);
556
557
virtual int constantWrapper (Node *n);
557
558
558
559
virtual String *makeParameterName (Node *n, Parm *p, int arg_num, bool is_setter = false ) const ;
@@ -565,7 +566,7 @@ class FORTRAN : public Language {
565
566
Wrapper *imfuncWrapper (Node *n, bool bindc);
566
567
Wrapper *proxyfuncWrapper (Node *n);
567
568
568
- int callbackHandler (Node *n);
569
+ int fortrancallbackHandler (Node *n);
569
570
int bindcfunctionHandler (Node *n);
570
571
int bindcvarWrapper (Node *n);
571
572
@@ -2463,7 +2464,7 @@ int FORTRAN::globalfunctionHandler(Node *n) {
2463
2464
// Flag is set to a non-"0" value
2464
2465
Node *cbnode = Getattr (n, " fortran:callback" );
2465
2466
if (!cbnode) {
2466
- this ->callbackHandler (n);
2467
+ this ->fortrancallbackHandler (n);
2467
2468
cbnode = Getattr (n, " fortran:callback" );
2468
2469
}
2469
2470
if (cbnode && Cmp (Getattr (cbnode, " sym:name" ), Getattr (n, " sym:name" )) == 0 ) {
@@ -2498,7 +2499,7 @@ int FORTRAN::globalfunctionHandler(Node *n) {
2498
2499
* might want to have two separate meaningful callback names and we don't want
2499
2500
* to mysteriously prevent one from being wrapped.
2500
2501
*/
2501
- int FORTRAN::callbackHandler (Node *n) {
2502
+ int FORTRAN::fortrancallbackHandler (Node *n) {
2502
2503
// Create a shallow copy of the node with params
2503
2504
Node *cbnode = copyNode (n);
2504
2505
Setattr (cbnode, " parms" , Getattr (n, " parms" ));
@@ -2817,6 +2818,21 @@ int FORTRAN::enumDeclaration(Node *n) {
2817
2818
return result;
2818
2819
}
2819
2820
2821
+
2822
+ /* -------------------------------------------------------------------------
2823
+ * \brief Process callbacks, which generate 'getter' wrapper functions
2824
+ *
2825
+ * To avoid breaking the later 'functionWrapper', we create a copy of the node.
2826
+ */
2827
+ int FORTRAN::callbackfunctionHandler (Node *n) {
2828
+ // Create a shallow copy of the node with params
2829
+ Node *cbnode = copyNode (n);
2830
+ Setattr (cbnode, " parms" , Getattr (n, " parms" ));
2831
+ Language::callbackfunctionHandler (cbnode);
2832
+ Setattr (n, " feature:callback:node" , cbnode);
2833
+ return SWIG_OK;
2834
+ }
2835
+
2820
2836
/* -------------------------------------------------------------------------
2821
2837
* \brief Process *compile-time* constants
2822
2838
*
@@ -3043,7 +3059,7 @@ String *FORTRAN::get_proxyname(Node *parent, SwigType *basetype) {
3043
3059
if (is_enum) {
3044
3060
set_nodeType (n, " enumforward" );
3045
3061
} else if (is_funptr) {
3046
- // Create a 'callback node' like callbackHandler
3062
+ // Create a 'callback node' like fortrancallbackHandler
3047
3063
set_nodeType (n, " cdecl" );
3048
3064
Setattr (n, " kind" , " function" );
3049
3065
Setattr (n, " storage" , " externc" );
0 commit comments