[PATCH] D53935: Delete dependency on config.h

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 31 08:24:03 PDT 2018


kadircet created this revision.
kadircet added a reviewer: sammccall.
Herald added subscribers: cfe-commits, jfb, arphaman, jkorous, ioeric, ilya-biryukov, krytarowski.

Since llvm/Config/config.h is not available on standalone builds,
use __USE_POSIX instead of HAVE_PTHREAD_H and get rid of the include.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53935

Files:
  clangd/Threading.cpp


Index: clangd/Threading.cpp
===================================================================
--- clangd/Threading.cpp
+++ clangd/Threading.cpp
@@ -1,11 +1,10 @@
 #include "Threading.h"
 #include "Trace.h"
 #include "llvm/ADT/ScopeExit.h"
-#include "llvm/Config/config.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Threading.h"
 #include <thread>
-#ifdef HAVE_PTHREAD_H
+#if defined(__USE_POSIX)
 #include <pthread.h>
 #endif
 
@@ -102,7 +101,7 @@
 }
 
 void setThreadPriority(std::thread &T, ThreadPriority Priority) {
-#if defined(HAVE_PTHREAD_H) && defined(__linux__)
+#if defined(__USE_POSIX) && defined(__linux__)
   sched_param priority;
   priority.sched_priority = 0;
   pthread_setschedparam(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53935.171929.patch
Type: text/x-patch
Size: 727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181031/10877820/attachment.bin>


More information about the cfe-commits mailing list