diff mbox series

[ovs-dev,2/4] windows: Add interlocked function definitions for VS 2015

Message ID 20171101171907.14588-3-aserdean@ovn.org
State Accepted
Headers show
Series windows: Add support for compiling using 2015/2017 | expand

Commit Message

Alin-Gabriel Serdean Nov. 1, 2017, 5:19 p.m. UTC
For some unclear and accidental reasons, the Windows 10 SDK
renamed _Interlocked* functions to _InlineInterlocked* (although the
documentation still points to the old form:
https://msdn.microsoft.com/en-us/library/191ca0sk.aspx).

This patch adds mappings for used functions.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
---
 lib/ovs-atomic-msvc.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ben Pfaff Nov. 3, 2017, 6:36 p.m. UTC | #1
On Wed, Nov 01, 2017 at 07:19:05PM +0200, Alin Gabriel Serdean wrote:
> For some unclear and accidental reasons, the Windows 10 SDK
> renamed _Interlocked* functions to _InlineInterlocked* (although the
> documentation still points to the old form:
> https://msdn.microsoft.com/en-us/library/191ca0sk.aspx).
> 
> This patch adds mappings for used functions.
> 
> Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>

How odd.  I'll take your word for it.

Acked-by: Ben Pfaff <blp@ovn.org>
Anand Kumar Nov. 8, 2017, 1:16 a.m. UTC | #2
Acked-by: Anand Kumar <kumaranand@vmware.com>

Thanks,
Anand Kumar

On 11/1/17, 10:19 AM, "ovs-dev-bounces@openvswitch.org on behalf of Alin Gabriel Serdean" <ovs-dev-bounces@openvswitch.org on behalf of aserdean@ovn.org> wrote:

    For some unclear and accidental reasons, the Windows 10 SDK
    renamed _Interlocked* functions to _InlineInterlocked* (although the
    documentation still points to the old form:
    https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_191ca0sk.aspx&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Q5z9tBe-nAOpE7LIHSPV8uy5-437agMXvkeHHMkR8Us&m=Q-1na_axrIAviBpv3JSA5qsudSXHDm6iTmqa67WtlO8&s=G52dBandLIsVPpF8RIu0ZPI_73yJD2ypZBEtkK3uzr4&e=).
    
    This patch adds mappings for used functions.
    
    Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
    ---
     lib/ovs-atomic-msvc.h | 7 +++++++
     1 file changed, 7 insertions(+)
    
    diff --git a/lib/ovs-atomic-msvc.h b/lib/ovs-atomic-msvc.h
    index 0b041c6..81f7682 100644
    --- a/lib/ovs-atomic-msvc.h
    +++ b/lib/ovs-atomic-msvc.h
    @@ -41,6 +41,13 @@ typedef enum {
         memory_order_seq_cst
     } memory_order;
     
    +#if _MSC_VER > 1800 && defined(_M_IX86)
    +/* From WDK 10 _InlineInterlocked* functions are renamed to
    + * _InlineInterlocked* although the documentation does not specify it */
    +#define _InterlockedExchangeAdd64 _InlineInterlockedExchangeAdd64
    +#define _InterlockedExchange64 _InlineInterlockedExchange64
    +#endif
    +
     #define ATOMIC_BOOL_LOCK_FREE 2
     #define ATOMIC_CHAR_LOCK_FREE 2
     #define ATOMIC_SHORT_LOCK_FREE 2
    -- 
    2.10.2.windows.1
    
    _______________________________________________
    dev mailing list
    dev@openvswitch.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=Q5z9tBe-nAOpE7LIHSPV8uy5-437agMXvkeHHMkR8Us&m=Q-1na_axrIAviBpv3JSA5qsudSXHDm6iTmqa67WtlO8&s=Fjk6juvMZ1YdJdXm2pwHOZFS88Y8tEZyFYlf9JqFgsw&e=
diff mbox series

Patch

diff --git a/lib/ovs-atomic-msvc.h b/lib/ovs-atomic-msvc.h
index 0b041c6..81f7682 100644
--- a/lib/ovs-atomic-msvc.h
+++ b/lib/ovs-atomic-msvc.h
@@ -41,6 +41,13 @@  typedef enum {
     memory_order_seq_cst
 } memory_order;
 
+#if _MSC_VER > 1800 && defined(_M_IX86)
+/* From WDK 10 _InlineInterlocked* functions are renamed to
+ * _InlineInterlocked* although the documentation does not specify it */
+#define _InterlockedExchangeAdd64 _InlineInterlockedExchangeAdd64
+#define _InterlockedExchange64 _InlineInterlockedExchange64
+#endif
+
 #define ATOMIC_BOOL_LOCK_FREE 2
 #define ATOMIC_CHAR_LOCK_FREE 2
 #define ATOMIC_SHORT_LOCK_FREE 2