mirror of
https://github.com/bellard/quickjs.git
synced 2026-04-02 21:28:02 +00:00
illumos build fix
This commit is contained in:
parent
f1139494d1
commit
5ee63d9b7d
4
cutils.h
4
cutils.h
@ -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
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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user