Make EFI port primary
This commit is contained in:
29
core/compat/math.h
Normal file
29
core/compat/math.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef COMPAT_MATH_H
|
||||
#define COMPAT_MATH_H
|
||||
|
||||
#define HUGE_VAL (__builtin_huge_val())
|
||||
#define NAN (__builtin_nan(""))
|
||||
#define INFINITY (__builtin_inf())
|
||||
|
||||
double fabs(double x);
|
||||
double floor(double x);
|
||||
double ceil(double x);
|
||||
double fmod(double x, double y);
|
||||
double pow(double x, double y);
|
||||
double sqrt(double x);
|
||||
double sin(double x);
|
||||
double cos(double x);
|
||||
double tan(double x);
|
||||
double asin(double x);
|
||||
double acos(double x);
|
||||
double atan(double x);
|
||||
double atan2(double y, double x);
|
||||
double exp(double x);
|
||||
double log(double x);
|
||||
double log10(double x);
|
||||
double cbrt(double x);
|
||||
double log2(double x);
|
||||
double trunc(double x);
|
||||
|
||||
|
||||
#endif
|
||||
9
core/compat/setjmp.h
Normal file
9
core/compat/setjmp.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef COMPAT_SETJMP_H
|
||||
#define COMPAT_SETJMP_H
|
||||
|
||||
typedef void *jmp_buf[5];
|
||||
|
||||
#define setjmp(env) __builtin_setjmp(env)
|
||||
#define longjmp(env, val) __builtin_longjmp(env, val)
|
||||
|
||||
#endif
|
||||
14
core/compat/stdarg.h
Normal file
14
core/compat/stdarg.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef COMPAT_STDARG_H
|
||||
#define COMPAT_STDARG_H
|
||||
|
||||
#ifndef MDE_CPU_X64
|
||||
#define MDE_CPU_X64
|
||||
#endif
|
||||
#include <Base.h>
|
||||
#include_next <stdarg.h>
|
||||
|
||||
#ifndef va_copy
|
||||
#define va_copy(dest, src) VA_COPY(dest, src)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
31
core/compat/stdint.h
Normal file
31
core/compat/stdint.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef COMPAT_STDINT_H
|
||||
#define COMPAT_STDINT_H
|
||||
|
||||
#ifndef MDE_CPU_X64
|
||||
#define MDE_CPU_X64
|
||||
#endif
|
||||
#include <Base.h>
|
||||
#include_next <stdint.h>
|
||||
|
||||
typedef int8_t int_least8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
#endif
|
||||
14
core/compat/stdio.h
Normal file
14
core/compat/stdio.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef COMPAT_STDIO_H
|
||||
#define COMPAT_STDIO_H
|
||||
|
||||
#ifndef MDE_CPU_X64
|
||||
#define MDE_CPU_X64
|
||||
#endif
|
||||
#include <Base.h>
|
||||
#include_next <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
||||
int snprintf(char *str, size_t size, const char *format, ...);
|
||||
|
||||
#endif
|
||||
13
core/compat/time.h
Normal file
13
core/compat/time.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef COMPAT_TIME_H
|
||||
#define COMPAT_TIME_H
|
||||
|
||||
#ifndef MDE_CPU_X64
|
||||
#define MDE_CPU_X64
|
||||
#endif
|
||||
#include <Base.h>
|
||||
#include_next <time.h>
|
||||
|
||||
double difftime(time_t time1, time_t time0);
|
||||
|
||||
|
||||
#endif
|
||||
12
core/compat/windows.h
Normal file
12
core/compat/windows.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* Dummy windows.h for Duktape compatibility in EFI */
|
||||
#ifndef WINDOWS_H
|
||||
#define WINDOWS_H
|
||||
|
||||
#ifndef MDE_CPU_X64
|
||||
#define MDE_CPU_X64
|
||||
#endif
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user