swig/Source
Jiulong Wang e1afb6fdbe Fix enum error when value contains char in compound expression
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.
2016-09-07 15:46:16 -07:00
..
CParse Fix enum error when value contains char in compound expression 2016-09-07 15:46:16 -07:00
DOH Warning fixes for 64bit visual c++ on Windows 2015-07-03 20:59:24 +01:00
Include Create javainterfacecode and csinterfacecode typemaps 2016-02-23 07:30:00 +00:00
Modules Make Python builtin types hashable by default 2016-08-23 19:06:36 +01:00
Preprocessor Ignore unknown preprocessor directives which are inside an inactive 2015-04-30 13:40:42 +12:00
Swig Fix leaked file descriptor 2016-06-16 15:53:22 +03:00
Makefile.am Re-organization of the interface feature common code 2016-03-03 08:55:20 +00:00
README update this README 2008-11-03 13:32:33 +00:00

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.