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.
This commit is contained in:
Andrew Kaster 2022-10-09 15:35:58 -06:00 committed by Linus Groh
parent a81475d9fb
commit 896d4e8dc1
Notes: sideshowbarker 2024-07-17 06:06:30 +09:00
2 changed files with 5 additions and 8 deletions

View File

@ -482,10 +482,9 @@ if (BUILD_LAGOM)
)
# Regex
file(GLOB LIBREGEX_LIBC_SOURCES "../../Userland/Libraries/LibRegex/C/Regex.cpp")
file(GLOB LIBREGEX_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibRegex/*.cpp")
lagom_lib(Regex regex
SOURCES ${LIBREGEX_SOURCES} ${LIBREGEX_LIBC_SOURCES}
SOURCES ${LIBREGEX_SOURCES}
LIBS LibUnicode
)

View File

@ -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;