[ofw] [PATCH] winverbs: export WvGetObject as extern C

Sean Hefty sean.hefty at intel.com
Tue Jun 2 16:54:11 PDT 2009


If a standard C program or library tries to link against winverbs, it will fail
because of C++ name decoration.  Export the WvGetObject call using C naming
conventions.

This allows DAPL to link directly against winverbs.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
diff -up -r -X \mshefty\scm\winof\trunk\docs\dontdiff.txt -I '\$Id:' trunk\core\winverbs/user/wv_main.cpp
branches\winverbs\core\winverbs/user/wv_main.cpp
--- trunk\core\winverbs/user/wv_main.cpp	2009-02-24 15:10:00.126625000 -0800
+++ branches\winverbs\core\winverbs/user/wv_main.cpp	2009-06-02 13:25:49.154564200 -0700
@@ -47,7 +47,7 @@ STDAPI DllCanUnloadNow(void)
 	return WvRef ? S_FALSE : S_OK;
 }
 
-__declspec(dllexport) HRESULT WvGetObject(REFIID riid, LPVOID FAR* ppvObj)
+extern "C" __declspec(dllexport) HRESULT WvGetObject(REFIID riid, LPVOID FAR* ppvObj)
 {
 	if (riid != IID_IWVProvider) {
 		*ppvObj = NULL;
diff -up -r -X \mshefty\scm\winof\trunk\docs\dontdiff.txt -I '\$Id:' trunk\inc\user\rdma/winverbs.h
branches\winverbs\inc\user\rdma/winverbs.h
--- trunk\inc\user\rdma/winverbs.h	2009-05-27 12:11:07.088250000 -0700
+++ branches\winverbs\inc\user\rdma/winverbs.h	2009-06-02 13:23:44.246541100 -0700
@@ -1510,6 +1510,10 @@ DECLARE_INTERFACE_(IWVProvider, IUnknown
 		) PURE;
 };
 
+#ifdef __cplusplus
+extern "C" __declspec(dllexport) HRESULT WvGetObject(REFIID riid, LPVOID FAR* ppvObj);
+#else
 __declspec(dllexport) HRESULT WvGetObject(REFIID riid, LPVOID FAR* ppvObj);
+#endif
 
 #endif // _WINVERBS_H_





More information about the ofw mailing list