Problem: When enum value contains compound expression with a char
constant, the quotes around char constant is missing in the generated
expression. Example:
enum media_type {
YUY2 = ((('2' << 24) | ('Y' << 16)) | ('U' << 8)) | 'Y'
};
The generated C# enum becomes:
public enum media_type {
YUY2 = (((2 << 24)|(Y << 16))|(U << 8))|Y
}
While the correct representation (after this fix) should be:
public enum media_type {
YUY2 = ((('2' << 24)|('Y' << 16))|('U' << 8))|'Y'
}
Causes: the exprcompound promotes the expression type from char to int
and uses $1.val in the generated expression. However $1.val does not
contain the quotes. Since the type is promoted to int, there's no way to
know there's char component in the compound expression.
Solution: in exprcomound, use $1.rawval if $1.type is T_CHAR or T_WCHAR.
The rawval contains quotes which yield correct expression.
|
||
|---|---|---|
| .. | ||
| CParse | ||
| DOH | ||
| Include | ||
| Modules | ||
| Preprocessor | ||
| Swig | ||
| Makefile.am | ||
| README | ||
SWIG Source directory
Source/DOH - A core set of basic datatypes including
strings, lists, hashes, and files. Used
extensively by the rest of SWIG.
Source/Swig - Swig core. Type-system, utility functions.
Source/Preprocessor - SWIG C Preprocessor
Source/CParse - SWIG C Parser (still messy)
Source/Modules - Language modules.
Source/Include - Include files.
Historic directories which may be in CVS, but have been removed:
Source/Modules1.1 - Old SWIG-1.1 modules. Empty.
Source/LParse - Experimental parser. Officially dead
as CParse is more capable.
Source/SWIG1.1 - Old SWIG1.1 core. Completely empty now.