From: SourceForge.net <no...@so...> - 2007-09-18 00:47:58
|
Bugs item #1760148, was opened at 2007-07-25 09:47 Message generated for change (Settings changed) made by olly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1760148&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: tcl Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Valery Sigalov (valery_sigalov) Assigned to: Nobody/Anonymous (nobody) >Summary: [tcl] Constants and enums - apply rule not working Initial Comment: I am upgrading from version 1.3.19 to 1.3.31. The following code is working fine with the old version: #ifdef SWIG %{ #include "test.h" %} %include "tclsh.i" %module test %apply int CONSTANT { int }; #endif #include <stdio.h> #define FOO 42 void bar(int x) { printf("%d\n", x); } %bar FOO 42 % But with the new version I receive this warning: test.cpp:7: Warning(453): Can't apply (int CONSTANT). No typemaps are defined. And as a result: % bar FOO expected integer but got "FOO":bar x argument 1 % The documentation states: 31.3.4 Constants and enums If a program relies on a lot of constants, this can be extremely annoying. To fix the problem, consider using the following typemap rule: %apply int CONSTANT { int x }; #define FOO 42 void bar(int x); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1760148&group_id=1645 |