illumos build fix

This commit is contained in:
Jiwon Na 2026-01-02 09:36:56 +09:00
parent f1139494d1
commit 5ee63d9b7d
4 changed files with 17 additions and 1 deletions

@ -29,6 +29,10 @@
#include <string.h>
#include <inttypes.h>
#if defined(__sun)
#undef __maybe_unused
#endif
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#define force_inline inline __attribute__((always_inline))

2
qjs.c

@ -143,6 +143,8 @@ static size_t js_trace_malloc_usable_size(const void *ptr)
return 0;
#elif defined(__linux__) || defined(__GLIBC__)
return malloc_usable_size((void *)ptr);
#elif defined(__sun)
return 0;
#else
/* change this to `return 0;` if compilation fails */
return malloc_usable_size((void *)ptr);

@ -62,6 +62,11 @@ typedef sig_t sighandler_t;
#endif
#endif /* __APPLE__ */
#ifdef __sun
typedef void (*sighandler_t)(int);
extern char **environ;
#endif
#endif
/* enable the os.Worker API. It relies on POSIX threads */

@ -39,6 +39,9 @@
#elif defined(__FreeBSD__)
#include <malloc_np.h>
#endif
#if defined(__sun)
#include <alloca.h>
#endif
#include "cutils.h"
#include "list.h"
@ -1725,6 +1728,8 @@ static size_t js_def_malloc_usable_size(const void *ptr)
return 0;
#elif defined(__linux__) || defined(__GLIBC__)
return malloc_usable_size((void *)ptr);
#elif defined(__sun)
return 0;
#else
/* change this to `return 0;` if compilation fails */
return malloc_usable_size((void *)ptr);
@ -46788,7 +46793,7 @@ static int getTimezoneOffset(int64_t time)
}
}
ti = time;
#if defined(_WIN32)
#if defined(_WIN32) || defined(__sun)
{
struct tm *tm;
time_t gm_ti, loc_ti;