Skip to content

Commit 9093ba9

Browse files
fsfodtstellar
andauthored
[Support] Include Support/thread.h before api implementations (#111175)
This header was included after the implementations to work around an issue with FreeBSD, however, , this causes some issues when dllexport\explicit visibility attributes will be added to the headers on Windows, since the definitions need to see the declarations for the attributes to apply. This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on windows. --------- Co-authored-by: Tom Stellard <[email protected]>
1 parent 1be849c commit 9093ba9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

llvm/lib/Support/Unix/Threading.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
#include <pthread_np.h> // For pthread_getthreadid_np() / pthread_set_name_np()
3434
#endif
3535

36+
// Must be included after Threading.inc to provide definition for llvm::thread
37+
// because FreeBSD's condvar.h (included by user.h) misuses the "thread"
38+
// keyword.
39+
#ifndef __FreeBSD__
40+
#include "llvm/Support/thread.h"
41+
#endif
42+
3643
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
3744
#include <errno.h>
3845
#include <sys/cpuset.h>

llvm/lib/Support/Windows/Threading.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "llvm/ADT/SmallString.h"
1414
#include "llvm/ADT/Twine.h"
15+
#include "llvm/Support/thread.h"
1516

1617
#include "llvm/Support/Windows/WindowsSupport.h"
1718
#include <process.h>

0 commit comments

Comments
 (0)