Hi,


Visual Studio 2010 refuses to compile the latest code on branch release/2.3
because __func__ is not supported. Microsoft supports __FUNCTION__ instead
of __func__ in their compiler. VS 2013 complains the same.



The following patch resolves this issue.





diff --git a/src/openvpn/crypto.c b/src/openvpn/crypto.c

index aa93a7b..c4fda84 100644

--- a/src/openvpn/crypto.c

+++ b/src/openvpn/crypto.c

@@ -423,7 +423,7 @@ crypto_adjust_frame_parameters(struct frame *frame,

   frame_add_to_extra_frame (frame, crypto_overhead);



   msg(D_MTU_DEBUG, "%s: Adjusting frame parameters for crypto by %zu
bytes",

-      __func__, crypto_overhead);

+      CURRENT_FUNCTION, crypto_overhead);

}



/*

diff --git a/src/openvpn/crypto.h b/src/openvpn/crypto.h

index e489827..66704ba 100644

--- a/src/openvpn/crypto.h

+++ b/src/openvpn/crypto.h

@@ -459,6 +459,15 @@ key_ctx_bi_defined(const struct key_ctx_bi* key)

   return key->encrypt.cipher || key->encrypt.hmac || key->decrypt.cipher ||
key->decrypt.hmac;

}



+/*

+ * __func__ is not yet supported on Visual Studio 2013

+ */

+

+#ifdef _MSC_VER

+    #define CURRENT_FUNCTION __FUNCTION__

+#else

+    #define CURRENT_FUNCTION __func__

+#endif



#endif /* ENABLE_CRYPTO */

#endif /* CRYPTO_H */



Best,

Fish

Reply via email to