[ovs-dev,3/7] MSVC64 atomics
diff mbox

Message ID 1442951618-13080-4-git-send-email-aserdean@cloudbasesolutions.com
State Rejected
Headers show

Commit Message

Alin Serdean Sept. 22, 2015, 7:53 p.m. UTC
In case of MSVC 64 bit compiler use ovs-atomic-pthreads for now.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
---
 lib/ovs-atomic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gurucharan Shetty Sept. 23, 2015, 2:55 p.m. UTC | #1
On Tue, Sep 22, 2015 at 12:53 PM, Alin Serdean
<aserdean@cloudbasesolutions.com> wrote:
> In case of MSVC 64 bit compiler use ovs-atomic-pthreads for now.
>
> Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
> ---
>  lib/ovs-atomic.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
> index b38c9ef..f5459d6 100644
> --- a/lib/ovs-atomic.h
> +++ b/lib/ovs-atomic.h
> @@ -333,7 +333,7 @@
>          #include "ovs-atomic-i586.h"
>      #elif HAVE_GCC4_ATOMICS
>          #include "ovs-atomic-gcc4+.h"
> -    #elif _MSC_VER && _M_IX86 >= 500
> +    #elif _MSC_VER && _M_IX86 >= 500 && !defined(WIN64)
The link https://msdn.microsoft.com/en-us/library/b0084kay.aspx says:

_M_IX86

Defined for compilations that target x86 processors. This is not
defined for x64 processors.

Is the above statement in the link wrong? What is the value of _M_IX86
in 64 bit compilation?



>          #include "ovs-atomic-msvc.h"
>      #else
>          /* ovs-atomic-pthreads implementation is provided for portability.
> --
> 1.9.5.msysgit.0
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
Alin Serdean Sept. 23, 2015, 4:52 p.m. UTC | #2
You are right Guru.
_M_IX86 is not defined in the case of x64 processors.

This patch can be dropped.

Alin

> -----Mesaj original-----

> De la: Gurucharan Shetty [mailto:shettyg@nicira.com]

> Trimis: Wednesday, September 23, 2015 5:56 PM

> C─âtre: Alin Serdean <aserdean@cloudbasesolutions.com>

> Cc: dev@openvswitch.org

> Subiect: Re: [ovs-dev] [PATCH 3/7] MSVC64 atomics

> 

> On Tue, Sep 22, 2015 at 12:53 PM, Alin Serdean

> <aserdean@cloudbasesolutions.com> wrote:

> > In case of MSVC 64 bit compiler use ovs-atomic-pthreads for now.

> >

> > Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>

> > ---

> >  lib/ovs-atomic.h | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> >

> > diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h index

> > b38c9ef..f5459d6 100644

> > --- a/lib/ovs-atomic.h

> > +++ b/lib/ovs-atomic.h

> > @@ -333,7 +333,7 @@

> >          #include "ovs-atomic-i586.h"

> >      #elif HAVE_GCC4_ATOMICS

> >          #include "ovs-atomic-gcc4+.h"

> > -    #elif _MSC_VER && _M_IX86 >= 500

> > +    #elif _MSC_VER && _M_IX86 >= 500 && !defined(WIN64)

> The link https://msdn.microsoft.com/en-us/library/b0084kay.aspx says:

> 

> _M_IX86

> 

> Defined for compilations that target x86 processors. This is not defined for

> x64 processors.

> 

> Is the above statement in the link wrong? What is the value of _M_IX86 in 64

> bit compilation?

> 

> 

> 

> >          #include "ovs-atomic-msvc.h"

> >      #else

> >          /* ovs-atomic-pthreads implementation is provided for portability.

> > --

> > 1.9.5.msysgit.0

> > _______________________________________________

> > dev mailing list

> > dev@openvswitch.org

> > http://openvswitch.org/mailman/listinfo/dev

Patch
diff mbox

diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
index b38c9ef..f5459d6 100644
--- a/lib/ovs-atomic.h
+++ b/lib/ovs-atomic.h
@@ -333,7 +333,7 @@ 
         #include "ovs-atomic-i586.h"
     #elif HAVE_GCC4_ATOMICS
         #include "ovs-atomic-gcc4+.h"
-    #elif _MSC_VER && _M_IX86 >= 500
+    #elif _MSC_VER && _M_IX86 >= 500 && !defined(WIN64)
         #include "ovs-atomic-msvc.h"
     #else
         /* ovs-atomic-pthreads implementation is provided for portability.