Supplement _GNU_SOURCE with _COSMO_SOURCE

This commit is contained in:
Justine Tunney 2023-10-15 16:59:27 -07:00
parent e6b59bced2
commit 7b8024d088
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 8 additions and 14 deletions

View file

@ -27,7 +27,6 @@
*/ */
#include "libc/mem/mem.h" #include "libc/mem/mem.h"
#include "libc/str/str.h" #include "libc/str/str.h"
#define _GNU_SOURCE
#include "third_party/musl/search.h" #include "third_party/musl/search.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_THIRDPARTY_MUSL_SEARCH_H #ifndef COSMOPOLITAN_THIRDPARTY_MUSL_SEARCH_H
#define COSMOPOLITAN_THIRDPARTY_MUSL_SEARCH_H #define COSMOPOLITAN_THIRDPARTY_MUSL_SEARCH_H
/* clang-format off */
typedef enum { FIND, ENTER } ACTION; typedef enum { FIND, ENTER } ACTION;
typedef enum { preorder, postorder, endorder, leaf } VISIT; typedef enum { preorder, postorder, endorder, leaf } VISIT;
@ -13,7 +14,7 @@ int hcreate(size_t);
void hdestroy(void); void hdestroy(void);
ENTRY *hsearch(ENTRY, ACTION); ENTRY *hsearch(ENTRY, ACTION);
#ifdef _GNU_SOURCE #if defined(_GNU_SOURCE) || defined(_COSMO_SOURCE)
struct hsearch_data { struct hsearch_data {
struct __tab *__tab; struct __tab *__tab;
unsigned int __unused1; unsigned int __unused1;
@ -38,7 +39,7 @@ void *tfind(const void *, void *const *, int(*)(const void *, const void *));
void *tsearch(const void *, void **, int (*)(const void *, const void *)); void *tsearch(const void *, void **, int (*)(const void *, const void *));
void twalk(const void *, void (*)(const void *, VISIT, int)); void twalk(const void *, void (*)(const void *, VISIT, int));
#ifdef _GNU_SOURCE #if defined(_GNU_SOURCE) || defined(_COSMO_SOURCE)
struct qelem { struct qelem {
struct qelem *q_forw, *q_back; struct qelem *q_forw, *q_back;
char q_data[1]; char q_data[1];

View file

@ -26,8 +26,7 @@
*/ */
#include "libc/mem/mem.h" #include "libc/mem/mem.h"
#include "third_party/musl/search.h" #include "third_party/musl/tsearch.internal.h"
#include "third_party/musl/tsearch.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\ Musl libc (MIT License)\\n\

View file

@ -26,9 +26,7 @@
*/ */
#include "libc/mem/mem.h" #include "libc/mem/mem.h"
#define _GNU_SOURCE #include "third_party/musl/tsearch.internal.h"
#include "third_party/musl/search.h"
#include "third_party/musl/tsearch.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\ Musl libc (MIT License)\\n\

View file

@ -25,8 +25,7 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "third_party/musl/search.h" #include "third_party/musl/tsearch.internal.h"
#include "third_party/musl/tsearch.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\ Musl libc (MIT License)\\n\

View file

@ -27,8 +27,7 @@
*/ */
#include "libc/mem/mem.h" #include "libc/mem/mem.h"
#include "libc/str/str.h" #include "libc/str/str.h"
#include "third_party/musl/search.h" #include "third_party/musl/tsearch.internal.h"
#include "third_party/musl/tsearch.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\ Musl libc (MIT License)\\n\

View file

@ -25,8 +25,7 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "third_party/musl/search.h" #include "third_party/musl/tsearch.internal.h"
#include "third_party/musl/tsearch.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
Musl libc (MIT License)\\n\ Musl libc (MIT License)\\n\