Skip to content

[lldb] Simplify preprocessor conditional #124522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2025
Merged

[lldb] Simplify preprocessor conditional #124522

merged 1 commit into from
Jan 27, 2025

Conversation

labath
Copy link
Collaborator

@labath labath commented Jan 27, 2025

The long list of defines is just a very elaborate way to say "not windows".

The long list of defines is just a very elaborate way to say "not
windows".
@labath labath requested a review from DavidSpickett January 27, 2025 09:09
@labath labath requested a review from JDevlieghere as a code owner January 27, 2025 09:09
@llvmbot llvmbot added the lldb label Jan 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2025

@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)

Changes

The long list of defines is just a very elaborate way to say "not windows".


Full diff: https://github.com/llvm/llvm-project/pull/124522.diff

1 Files Affected:

  • (modified) lldb/source/Host/common/Host.cpp (+6-10)
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index fdb623667bc251..d5054008268b9d 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -11,13 +11,19 @@
 #include <climits>
 #include <cstdlib>
 #include <sys/types.h>
+
 #ifndef _WIN32
 #include <dlfcn.h>
 #include <grp.h>
 #include <netdb.h>
 #include <pwd.h>
 #include <sys/stat.h>
+#include <sys/syscall.h>
+#include <sys/wait.h>
 #include <unistd.h>
+#if !defined(__ANDROID__)
+#include <spawn.h>
+#endif
 #endif
 
 #if defined(__APPLE__)
@@ -26,16 +32,6 @@
 #include <mach/mach_port.h>
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) ||                              \
-    defined(__FreeBSD_kernel__) || defined(__APPLE__) ||                       \
-    defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
-#if !defined(__ANDROID__)
-#include <spawn.h>
-#endif
-#include <sys/syscall.h>
-#include <sys/wait.h>
-#endif
-
 #if defined(__FreeBSD__)
 #include <pthread_np.h>
 #endif

Copy link
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose there might be some platform out there we don't know about that this breaks, but what better way to find out than changing it :)

LGTM.

@labath labath merged commit 6087c30 into llvm:main Jan 27, 2025
9 checks passed
@labath labath deleted the not-win branch January 27, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants