Skip to content

[Windows] Support microsoft intrinsics #13655

Closed
@timurrrr

Description

@timurrrr
Bugzilla Link 13283
Resolution FIXED
Resolved on Feb 27, 2014 18:31
Version trunk
OS Windows NT
Blocks llvm/llvm-bugzilla-archive#13707
CC @asl,@benlangmuir,@DougGregor,@tritao,@nico,@rnk

Extended Description

E.g. _InterlockedDecrement http://msdn.microsoft.com/en-us/library/windows/desktop/f24ya7ct(v=vs.85).aspx

$ cat interlocked_decrement.c
#include <windows.h>

int main(void) {
LONG val = 1;
_InterlockedDecrement(&val);
return val != 0;
}

$ cl -nologo interlocked_decrement.c && interlocked_decrement.exe && echo "OK"
interlocked_decrement.c
OK

$ clang interlocked_decrement.c
interlocked_decrement.c:5:3: warning: implicit declaration of function '_InterlockedDecrement' is invalid in C99 [-Wimplicit-function-declaration]
_InterlockedDecrement(&val);
^
1 warning generated.
interlocked_decrement-199938.o : error LNK2019: unresolved external symbol __InterlockedDecrement referenced in function _main
a.out : fatal error LNK1120: 1 unresolved externals
clang: error: linker command failed with exit code 1120 (use -v to see invocation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions