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.
[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],
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.
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
#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
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
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
* 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. */
#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