[Mono.Posix] Fix INTL.DLL CallingConvention.
authorJonathan Pryor <jonpryor@vt.edu>
Tue, 21 May 2013 00:34:50 +0000 (20:34 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Tue, 21 May 2013 00:35:47 +0000 (20:35 -0400)
INTL.DLL on Windows uses the `__cdecl` calling convention.

Let's not corrupt the stack on Windows...

mcs/class/Mono.Posix/Mono.Unix/Catalog.cs

index d835fec46245715b7fe3e8feaae6ab08d4e6cef0..90bddb0fbf4abb8d58e6199b4095816dc4d7b49c 100644 (file)
@@ -40,12 +40,12 @@ namespace Mono.Unix {
        public class Catalog {
                private Catalog () {}
 
-               [DllImport("intl")]
+               [DllImport("intl", CallingConvention=CallingConvention.Cdecl)]
                static extern IntPtr bindtextdomain (IntPtr domainname, IntPtr dirname);
-               [DllImport("intl")]
+               [DllImport("intl", CallingConvention=CallingConvention.Cdecl)]
                static extern IntPtr bind_textdomain_codeset (IntPtr domainname,
                        IntPtr codeset);
-               [DllImport("intl")]
+               [DllImport("intl", CallingConvention=CallingConvention.Cdecl)]
                static extern IntPtr textdomain (IntPtr domainname);
                
                public static void Init (String package, String localedir)
@@ -91,7 +91,7 @@ namespace Mono.Unix {
                        }
                }
        
-               [DllImport("intl")]
+               [DllImport("intl", CallingConvention=CallingConvention.Cdecl)]
                static extern IntPtr gettext (IntPtr instring);
                
                public static String GetString (String s)
@@ -109,7 +109,7 @@ namespace Mono.Unix {
                        }
                }
        
-               [DllImport("intl")]
+               [DllImport("intl", CallingConvention=CallingConvention.Cdecl)]
                static extern IntPtr ngettext (IntPtr singular, IntPtr plural, Int32 n);
                
                public static String GetPluralString (String s, String p, Int32 n)