Skip to content

Commit 0cec6b4

Browse files
committed
Some _SC* macros are not available from the Cosmopolitan libc
This patch is probably the more invasive about Esperanto/Cosmopolitan. It adds a new compilation path when [__ESPERANTO__] is defined. A note was added to explain where it comes from: the cross-compiler [arch-esperanto-none-static-cc] systematically defines [-D__ESPERANTO__] in order to let third-party libraries (such as lwt) to choose different compilation paths. And here we are! Cosmopolitan does not defines required [_SC*] constants and [unix_get_pw_gr_nam_id_job] can not be compiled. We discard this piece of code when we want to compile with Cosmopolitan as it's the case for Android too.
1 parent ea1aac6 commit 0cec6b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/unix/unix_c/unix_get_pw_gr_nam_id_job.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020

2121
#include "lwt_unix.h"
2222

23-
#if !defined(__ANDROID__)
23+
/* NOTE: [__ESPERANTO__] is defined by the cross-compiler if we compile into
24+
* the [esperanto] context (with [arch-esperanto-none-static-cc]). Otherwise,
25+
* nobody should define this macro. The code above can not be compiled with
26+
* Esperanto/Cosmopolitan due to missing [_SC*] macros. */
27+
#if !defined(__ANDROID__) && !defined(__ESPERANTO__)
2428

2529
static value alloc_passwd_entry(struct passwd *entry)
2630
{

0 commit comments

Comments
 (0)