dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[dotgnu-pnet-commits] pnet ChangeLog codegen/cg_genattr.c


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnet ChangeLog codegen/cg_genattr.c
Date: Thu, 23 Apr 2009 18:17:10 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnet
Changes by:     Klaus Treichel <ktreichel>      09/04/23 18:17:09

Modified files:
        .              : ChangeLog 
        codegen        : cg_genattr.c 

Log message:
        Set the correct values for calling convention and characterset for the
        DllImportAttribute.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3621&r2=1.3622
http://cvs.savannah.gnu.org/viewcvs/pnet/codegen/cg_genattr.c?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3621
retrieving revision 1.3622
diff -u -b -r1.3621 -r1.3622
--- ChangeLog   21 Apr 2009 19:35:49 -0000      1.3621
+++ ChangeLog   23 Apr 2009 18:17:08 -0000      1.3622
@@ -1,3 +1,8 @@
+2009-04-23  Klaus Treichel  <address@hidden>
+
+       * codegen/cg_genattr.c (DllImportAttribute): Set the correct default
+       values for calling convention and characterset.
+       
 2009-04-21  Klaus Treichel  <address@hidden>
 
        * codegen/cg_genattr.c (DefaultValueAttribute): Use the ctor argument

Index: codegen/cg_genattr.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_genattr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- codegen/cg_genattr.c        21 Apr 2009 19:35:49 -0000      1.3
+++ codegen/cg_genattr.c        23 Apr 2009 18:17:09 -0000      1.4
@@ -934,11 +934,13 @@
        ILField *field = 0;
        ILModule *module;
        ILUInt32 attrMask = 0;
-       ILUInt32 attrs = 0;
+       ILUInt32 attrs;
        const char *dllName = 0;
        const char *entryPoint = 0;
        int currentNamedArg;
 
+       /* Set the default value for the attributes */
+       attrs = IL_META_PINVOKE_CHAR_SET_ANSI | 
IL_META_PINVOKE_CALL_CONV_STDCALL;
        if((method = ILProgramItemToMethod(attributeInfo->owner)) != 0)
        {
                /* Nothing to do here */
@@ -1005,6 +1007,7 @@
                                continue;
                        }
                        attrMask |= IL_META_PINVOKE_CALL_CONV_MASK;
+                       attrs &= ~IL_META_PINVOKE_CALL_CONV_MASK;
                        attrs |= (callConv << 8);
                }
                else if(!strcmp(attrFieldName, "CharSet"))
@@ -1012,6 +1015,7 @@
                        ILUInt32 charSet;
        
                        attrMask |= IL_META_PINVOKE_CHAR_SET_MASK;
+                       attrs &= ~IL_META_PINVOKE_CHAR_SET_MASK;
                        charSet = 
attributeInfo->namedArgs[currentNamedArg].evalValue.un.i4Value;
                        switch(charSet)
                        {




reply via email to

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