summaryrefslogtreecommitdiff
path: root/README_win32.txt
blob: 174de576075e9cb00b955db7cf01caa252e34ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Most of the atomic_ops functionality is available under Win32 with
the Microsoft tools, but the build process is more primitive than that on
Linux/Unix platforms.

To build:
1) Go to the src directory in the distribution.
2) Make sure the Microsoft command-line tools (e.g. nmake) are available.
3) Run "nmake -f Makefile.msft check".  This should build libatomic_ops_gpl.lib
and run some tests.
4) To compile applications, you will need to retain or copy the following
pieces from the resulting src directory contents:
        "atomic_ops.h" - Header file defining low-level primitives.  This
                         includes files from the following folder.
        "atomic_ops" - Subdirectory containing implementation header files.
        "atomic_ops_stack.h" - Header file describing almost lock-free stack.
        "atomic_ops_malloc.h" - Header file describing almost lock-free malloc.
        "libatomic_ops_gpl.lib" - Library containing implementation of the
                        above two (plus AO_pause() defined in atomic_ops.c).
                        The atomic_ops.h implementation is entirely in the
                        header files in Win32.

Note that the library is covered by the GNU General Public License, while
the top 2 of these pieces allow use in proprietary code.

There are several macros a client could use to configure the build with the
Microsoft tools (except for AO_CMPXCHG16B_AVAILABLE one, others should be
rarely needed in practice):
* AO_ASM_X64_AVAILABLE - inline assembly available (only x86_64)
* AO_ASSUME_VISTA - assume Windows Server 2003, Vista or later target (only
  x86, implied if Visual Studio 2015 or older)
* AO_CMPXCHG16B_AVAILABLE - assume target is not old AMD Opteron chip (only
  x86_64)
* AO_OLD_STYLE_INTERLOCKED_COMPARE_EXCHANGE - assume ancient MS VS Win32
  headers (only arm and x86)
* AO_PREFER_GENERALIZED - prefer generalized definitions to direct
  assembly-based ones
* AO_UNIPROCESSOR - assume single-core target (only arm)
* AO_USE_INTERLOCKED_INTRINSICS - assume Win32 _Interlocked* primitives
  available as intrinsics (only arm)
* AO_USE_PENTIUM4_INSTRS - use mfence instruction instead of xchg (only x86,
  implied if SSE2 is available)