Commit 2761fc91 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

widl: Add __int32 type support.

parent 2172855f
......@@ -50,6 +50,7 @@ static int is_integer_type(const type_t *type)
case TYPE_BASIC_INT64:
case TYPE_BASIC_INT:
case TYPE_BASIC_INT3264:
case TYPE_BASIC_LONG:
case TYPE_BASIC_CHAR:
case TYPE_BASIC_HYPER:
case TYPE_BASIC_BYTE:
......@@ -82,6 +83,7 @@ static int is_signed_integer_type(const type_t *type)
case TYPE_BASIC_INT64:
case TYPE_BASIC_INT:
case TYPE_BASIC_INT3264:
case TYPE_BASIC_LONG:
return type_basic_get_sign(type) < 0;
case TYPE_BASIC_CHAR:
return TRUE;
......
......@@ -369,6 +369,7 @@ void write_type_left(FILE *h, type_t *t, enum name_type name_type, int declonly)
case TYPE_BASIC:
if (type_basic_get_type(t) != TYPE_BASIC_INT32 &&
type_basic_get_type(t) != TYPE_BASIC_INT64 &&
type_basic_get_type(t) != TYPE_BASIC_LONG &&
type_basic_get_type(t) != TYPE_BASIC_HYPER)
{
if (type_basic_get_sign(t) < 0) fprintf(h, "signed ");
......@@ -389,6 +390,12 @@ void write_type_left(FILE *h, type_t *t, enum name_type name_type, int declonly)
case TYPE_BASIC_HANDLE: fprintf(h, "handle_t"); break;
case TYPE_BASIC_INT32:
if (type_basic_get_sign(t) > 0)
fprintf(h, "UINT32");
else
fprintf(h, "INT32");
break;
case TYPE_BASIC_LONG:
if (type_basic_get_sign(t) > 0)
fprintf(h, "ULONG");
else
fprintf(h, "LONG");
......
......@@ -250,6 +250,7 @@ static const struct keyword keywords[] = {
{"TRUE", tTRUE},
{"__cdecl", tCDECL},
{"__fastcall", tFASTCALL},
{"__int32", tINT32},
{"__int3264", tINT3264},
{"__int64", tINT64},
{"__pascal", tPASCAL},
......
......@@ -208,7 +208,7 @@ static typelib_t *current_typelib;
%token tIMPORT tIMPORTLIB
%token tIN tIN_LINE tINLINE
%token tINPUTSYNC
%token tINT tINT3264 tINT64
%token tINT tINT32 tINT3264 tINT64
%token tINTERFACE
%token tLCID
%token tLENGTHIS tLIBRARY
......@@ -815,10 +815,11 @@ m_int:
int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); }
| tSHORT m_int { $$ = type_new_int(TYPE_BASIC_INT16, 0); }
| tSMALL { $$ = type_new_int(TYPE_BASIC_INT8, 0); }
| tLONG m_int { $$ = type_new_int(TYPE_BASIC_INT32, 0); }
| tLONG m_int { $$ = type_new_int(TYPE_BASIC_LONG, 0); }
| tHYPER m_int { $$ = type_new_int(TYPE_BASIC_HYPER, 0); }
| tINT64 { $$ = type_new_int(TYPE_BASIC_INT64, 0); }
| tCHAR { $$ = type_new_int(TYPE_BASIC_CHAR, 0); }
| tINT32 { $$ = type_new_int(TYPE_BASIC_INT32, 0); }
| tINT3264 { $$ = type_new_int(TYPE_BASIC_INT3264, 0); }
;
......@@ -1408,6 +1409,7 @@ static int is_allowed_range_type(const type_t *type)
case TYPE_BASIC_INT64:
case TYPE_BASIC_INT:
case TYPE_BASIC_INT3264:
case TYPE_BASIC_LONG:
case TYPE_BASIC_BYTE:
case TYPE_BASIC_CHAR:
case TYPE_BASIC_WCHAR:
......@@ -2399,6 +2401,7 @@ static int is_allowed_conf_type(const type_t *type)
case TYPE_BASIC_INT32:
case TYPE_BASIC_INT64:
case TYPE_BASIC_INT:
case TYPE_BASIC_LONG:
case TYPE_BASIC_CHAR:
case TYPE_BASIC_HYPER:
case TYPE_BASIC_BYTE:
......
......@@ -208,7 +208,8 @@ unsigned char get_basic_fc(const type_t *type)
{
case TYPE_BASIC_INT8: return (sign <= 0 ? FC_SMALL : FC_USMALL);
case TYPE_BASIC_INT16: return (sign <= 0 ? FC_SHORT : FC_USHORT);
case TYPE_BASIC_INT32: return (sign <= 0 ? FC_LONG : FC_ULONG);
case TYPE_BASIC_INT32:
case TYPE_BASIC_LONG: return (sign <= 0 ? FC_LONG : FC_ULONG);
case TYPE_BASIC_INT64: return FC_HYPER;
case TYPE_BASIC_INT: return (sign <= 0 ? FC_LONG : FC_ULONG);
case TYPE_BASIC_INT3264: return (sign <= 0 ? FC_INT3264 : FC_UINT3264);
......@@ -234,6 +235,7 @@ static unsigned char get_basic_fc_signed(const type_t *type)
case TYPE_BASIC_INT64: return FC_HYPER;
case TYPE_BASIC_INT: return FC_LONG;
case TYPE_BASIC_INT3264: return FC_INT3264;
case TYPE_BASIC_LONG: return FC_LONG;
case TYPE_BASIC_BYTE: return FC_BYTE;
case TYPE_BASIC_CHAR: return FC_CHAR;
case TYPE_BASIC_WCHAR: return FC_WCHAR;
......
......@@ -156,6 +156,7 @@ unsigned short get_type_vt(type_t *t)
else
return VT_INT;
case TYPE_BASIC_INT32:
case TYPE_BASIC_LONG:
case TYPE_BASIC_ERROR_STATUS_T:
if (type_basic_get_sign(t) > 0)
return VT_UI4;
......
......@@ -377,6 +377,7 @@ static int is_valid_bitfield_type(const type_t *type)
case TYPE_BASIC_INT64:
case TYPE_BASIC_INT:
case TYPE_BASIC_INT3264:
case TYPE_BASIC_LONG:
case TYPE_BASIC_CHAR:
case TYPE_BASIC_HYPER:
case TYPE_BASIC_BYTE:
......
......@@ -265,6 +265,7 @@ enum type_basic_type
TYPE_BASIC_INT64,
TYPE_BASIC_INT,
TYPE_BASIC_INT3264,
TYPE_BASIC_LONG,
TYPE_BASIC_CHAR,
TYPE_BASIC_HYPER,
TYPE_BASIC_BYTE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment