]> granicus.if.org Git - libatomic_ops/commitdiff
Always define word-wide CAS for x86 (MS VC++ 8 or later)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 20 Jan 2017 15:10:05 +0000 (18:10 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 20 Jan 2017 15:15:18 +0000 (18:15 +0300)
Visual Studio 2005 (MS VC++ 8.0) discontinued support of Windows 95.
This patch deprecates AO_ASSUME_WINDOWS98 macro.

* configure.ac (AO_ASSUME_WINDOWS98): Remove AH template.
* doc/README.txt (AO_ASSUME_WINDOWS98): Remove documentation (as
relates only to Win95).
* doc/README_win32.txt (AO_ASSUME_WINDOWS98): Likwise.
* doc/README_win32.txt (AO_ASSUME_VISTA): Update documentation.
* src/Makefile.msft (CFLAGS): Remove "-D AO_ASSUME_WINDOWS98".
* src/Makefile.msft (test_atomic_w95): Remove target.
* src/Makefile.msft (check): Do not call test_atomic_w95; remove the
corresponding printed message.
* src/atomic_ops/sysdeps/msftc/x86.h: Remove AO_ASSUME_WINDOWS98 from
comment.
* src/atomic_ops/sysdeps/msftc/x86.h (AO_ASSUME_WINDOWS98): Define
(implicitly) if _MSC_VER >= 1400.

configure.ac
doc/README.txt
doc/README_win32.txt
src/Makefile.msft
src/atomic_ops/sysdeps/msftc/x86.h

index d3eccf82d37a097a20f58b58ebbd5c5326e4e27f..9087c594919089912493ef22dcdeff28a38f9b97 100644 (file)
@@ -149,9 +149,6 @@ AH_TEMPLATE([AO_ASM_X64_AVAILABLE],
         [Inline assembly available (only VC/x86_64)])
 AH_TEMPLATE([AO_ASSUME_VISTA],
         [Assume Windows Server 2003, Vista or later target (only VC/x86)])
-AH_TEMPLATE([AO_ASSUME_WINDOWS98],
-        [Assume hardware compare-and-swap functionality available \
-         on target (only VC/x86)])
 AH_TEMPLATE([AO_CMPXCHG16B_AVAILABLE],
         [Assume target is not old AMD Opteron chip (only x86_64)])
 AH_TEMPLATE([AO_FORCE_USE_SWP],
index 5902e4f65ec70fa30f7cf489d36c7f3bebc0f57e..043ea0de53d50a473f7d33267f9ad24d285664d8 100644 (file)
@@ -230,12 +230,6 @@ Platform notes:
 
 All X86: We quietly assume 486 or better.
 
-Microsoft compilers:
-Define AO_ASSUME_WINDOWS98 to get access to hardware compare-and-swap
-functionality.  This relies on the InterlockedCompareExchange() function
-which was apparently not supported in Windows95.  (There may be a better
-way to get access to this.)
-
 Gcc on x86:
 Define AO_USE_PENTIUM4_INSTRS to use the Pentium 4 mfence instruction.
 Currently this is appears to be of marginal benefit.
index 812006c53f692ea7421503e4dd0b75b8b8c828e4..4f1f281092784a37c8b635884e81e403e0b309db 100644 (file)
@@ -22,10 +22,8 @@ pieces from the resulting src directory contents:
                         The atomic_ops.h implementation is entirely in the
                         header files in Win32.
 
-Most clients of atomic_ops.h will need to define AO_ASSUME_WINDOWS98 before
-including it.  Compare_and_swap is otherwise not available.
-Defining AO_ASSUME_VISTA will make compare_double_and_swap_double available
-as well.
+If the client defines AO_ASSUME_VISTA (before include atomic_ops.h), it should
+make double_compare_and_swap_full available.
 Please note that MS compiler for x86 does not align AO_double_t on an 8-byte
 boundary, thus to avoid an undefined behavior, an AO_double_t (volatile)
 variable should be declared with AO_DOUBLE_ALIGN attribute if the variable
index 56c0bc3c13bddb9c23635708908df3973c3cfe0a..143872004806c8dbb575b22565646f69457ced86 100644 (file)
@@ -16,7 +16,7 @@
 #CPU=$(MY_CPU)
 #!include <ntwin32.mak>
 
-CFLAGS=-O2 -W3 -DAO_ASSUME_WINDOWS98
+CFLAGS=-O2 -W3
 
 LIB_OBJS=atomic_ops.obj atomic_ops_malloc.obj atomic_ops_stack.obj
 
@@ -37,9 +37,6 @@ libatomic_ops_gpl.lib: $(LIB_OBJS)
 test_atomic: ..\tests\test_atomic.c ..\tests\test_atomic_include.h
        cl $(CFLAGS) -I. ..\tests\test_atomic.c /Fo.\test_atomic
 
-test_atomic_w95: ..\tests\test_atomic.c ..\tests\test_atomic_include.h
-       cl -W3 -O2 -I. ..\tests\test_atomic.c /Fo.\test_atomic_w95
-
 test_malloc: ..\tests\test_malloc.c libatomic_ops_gpl.lib
        cl $(CFLAGS) -I. ..\tests\test_malloc.c /Fo.\test_malloc \
            libatomic_ops_gpl.lib
@@ -48,9 +45,7 @@ test_stack: ..\tests\test_stack.c libatomic_ops_gpl.lib
        cl $(CFLAGS) -I. ..\tests\test_stack.c /Fo.\test_stack \
            libatomic_ops_gpl.lib
 
-check: test_atomic test_atomic_w95 test_malloc test_stack
-       @echo "The following will print lots of 'Missing ...' messages"
-       test_atomic_w95
+check: test_atomic test_malloc test_stack
        @echo "The following will print some 'Missing ...' messages"
        test_atomic
        test_malloc
index aa6ca1bf70647623f9c9962680a258922525b72f..d9272f5aad61ab58bd8af78a7d9f7e9e35173eed 100644 (file)
@@ -20,7 +20,6 @@
  * SOFTWARE.
  */
 
-/* If AO_ASSUME_WINDOWS98 is defined, we assume Windows 98 or newer.    */
 /* If AO_ASSUME_VISTA is defined, we assume Windows Server 2003, Vista  */
 /* or later.                                                            */
 
@@ -28,7 +27,9 @@
 
 #include "../test_and_set_t_is_char.h"
 
-#if defined(AO_ASSUME_VISTA) && !defined(AO_ASSUME_WINDOWS98)
+#if !defined(AO_ASSUME_WINDOWS98) \
+    && (defined(AO_ASSUME_VISTA) || _MSC_VER >= 1400)
+   /* Visual Studio 2005 (MS VC++ 8.0) discontinued support of Windows 95. */
 # define AO_ASSUME_WINDOWS98
 #endif