Make improvements

This commit is contained in:
Justine Tunney 2020-12-01 03:43:40 -08:00
parent 3e4fd4b0ad
commit e44a0cf6f8
256 changed files with 23100 additions and 2294 deletions

View file

@ -1,5 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_NT_CODEGEN_H_
#define COSMOPOLITAN_LIBC_NT_CODEGEN_H_
#include "ape/idata.internal.h"
#include "ape/macros.h"
#include "ape/macros.internal.h"
#endif /* COSMOPOLITAN_LIBC_NT_CODEGEN_H_ */

View file

@ -166,8 +166,8 @@ o/libc/nt/ntdllimport.inc: \
ape/relocations.h \
libc/nt/ntdllimport.h \
libc/macros.h \
libc/macros.inc \
libc/macros-cpp.inc
libc/macros.internal.inc \
libc/macros-cpp.internal.inc
#───────────────────────────────────────────────────────────────────────────────

View file

@ -32,12 +32,12 @@ COSMOPOLITAN_C_START_
cosmopolitan § new technology » synchronization
*/
#define InterlockedAdd(PTR, VAL) \
({ \
typeof(*(PTR)) Res; \
typeof(Res) Val = (VAL); \
asm volatile("xadd\t%0,%1" : "=r"(Res), "+m"(*(PTR)) : "0"(Val)); \
Res + Val; \
#define InterlockedAdd(PTR, VAL) \
({ \
typeof(*(PTR)) Res; \
typeof(Res) Val = (VAL); \
asm volatile("lock xadd\t%0,%1" : "=r"(Res), "+m"(*(PTR)) : "0"(Val)); \
Res + Val; \
})
#define InterlockedExchange(PTR, VAL) \