summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2022-10-09 15:35:58 -0600
committerLinus Groh <mail@linusgroh.de>2022-10-10 12:23:12 +0200
commit896d4e8dc1a91f577231afef9d127b51d7cc3630 (patch)
treeaff8c926bf6e567ad244045a873447a92f1ad47d /Userland
parenta81475d9fb926e123bf9f2c034ebaff59764b14a (diff)
downloadserenity-896d4e8dc1a91f577231afef9d127b51d7cc3630.zip
LibRegex: Don't build LibRegex/C/Regex.cpp on Lagom
This file implements the POSIX APIs from <regex.h>, and is not suitable for inclusion in a Lagom build. If we do include it, it will override the host's regex functions and wreak havoc if it's resolved before the host's implementation.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibRegex/C/Regex.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Userland/Libraries/LibRegex/C/Regex.cpp b/Userland/Libraries/LibRegex/C/Regex.cpp
index 28d93d5da6..b9a76394cc 100644
--- a/Userland/Libraries/LibRegex/C/Regex.cpp
+++ b/Userland/Libraries/LibRegex/C/Regex.cpp
@@ -6,19 +6,17 @@
#include <AK/String.h>
#include <AK/StringBuilder.h>
+#include <AK/Variant.h>
#include <LibRegex/Regex.h>
#include <ctype.h>
+#include <regex.h>
#include <stdio.h>
#include <string.h>
-#ifdef __serenity__
-# include <regex.h>
-#else
-# include <LibC/regex.h>
+#ifndef AK_OS_SERENITY
+# error "This file is intended for use on Serenity only to implement POSIX regex.h"
#endif
-#include <AK/Variant.h>
-
struct internal_regex_t {
u8 cflags;
u8 eflags;