]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix Microsoft Visual Studio incompatibility in plugin.c
authorDavid Sommerseth <davids@redhat.com>
Thu, 26 May 2011 13:23:03 +0000 (16:23 +0300)
committerDavid Sommerseth <davids@redhat.com>
Thu, 25 Aug 2011 18:12:37 +0000 (20:12 +0200)
MS Visual Studio don't like to have struct members named in the
variable declaration.  Without this fix, Visual Studio is not able
to compile the new v3 plug-in API.

Signed-off-by: David Sommerseth <davids@redhat.com>
Tested-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
plugin.c

index 56bd37ff6618e1aca36da14dbd7b249085a15f77..745ea514d4668b49293e7427578434e1d28b5462 100644 (file)
--- a/plugin.c
+++ b/plugin.c
@@ -299,9 +299,9 @@ plugin_open_item (struct plugin *p,
        * Call the plugin initialization
        */
       if (p->open3) {
-        struct openvpn_plugin_args_open_in args = { .type_mask = p->plugin_type_mask,
-                                                    .argv      = o->argv,
-                                                    .envp      = envp };
+        struct openvpn_plugin_args_open_in args = { p->plugin_type_mask,
+                                                    (const char ** const) o->argv,
+                                                    (const char ** const) envp };
         struct openvpn_plugin_args_open_return retargs;
 
         CLEAR(retargs);
@@ -367,13 +367,13 @@ plugin_call_item (const struct plugin *p,
        * Call the plugin work function
        */
       if (p->func3) {
-        struct openvpn_plugin_args_func_in args = { .type    = type,
-                                                    .argv    = (const char **) a.argv,
-                                                    .envp    = envp,
-                                                    .handle  = p->plugin_handle,
-                                                   .per_client_context = per_client_context,
-                                                   .current_cert_depth = (current_cert ? certdepth : -1),
-                                                   .current_cert = current_cert };
+        struct openvpn_plugin_args_func_in args = { type,
+                                                    (const char ** const) a.argv,
+                                                    (const char ** const) envp,
+                                                    p->plugin_handle,
+                                                    per_client_context,
+                                                    (current_cert ? certdepth : -1),
+                                                    current_cert };
         struct openvpn_plugin_args_func_return retargs;
 
         CLEAR(retargs);