[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Swig and C header files

From: Andrew Makhorin
Subject: Re: [Help-glpk] Swig and C header files
Date: Fri, 6 Feb 2009 06:18:08 +0300

>> Swig can read any file and action can be taken to overcome all(?)
>> problems. However apart from the multiple defines, now resolved, in
>> glpk_4.35 'in' and 'out' are used as names, which they were not
>> before. Note that 'in' and 'out' are reserved words in C#. Swig is
>> able to work around this but inconviniently. 

> In Python too, 'in' causes a trouble; swig renames it to '_in', to
> avoid the conflict with the Python keyword with the same name.

> The solution proposed by Xypron (renaming to 'in_arcs' and 'out_arcs')
> would solve the problem.

Identifiers 'in' and 'out' are not reserved keywords in C/C++, and
using them in C/C++ headers is valid. Changing valid identifiers just
because they are reserved in other languages is not a good idea.
I think that a more appropriate way is to use sed to make necessary
changes in glpk.h; and the sed script(s) could be included in the
distribution along with other swig stuff.

Andrew Makhorin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]