Skip to content

Commit

Permalink
Clean-up ffi.h. LuaTeX 1.20.1
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@73298 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
luigiScarso committed Jan 4, 2025
1 parent d651739 commit d949c9c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 21 deletions.
5 changes: 5 additions & 0 deletions texk/web2c/luatexdir/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2025-01-04 Luigi Scarso <[email protected]>
* Clean-up ffi.h
* LuaTeX 1.20.1


2025-01-01 Luigi Scarso <[email protected]>
* New luaffi, support for aarch64.
* LuaTeX 1.20.0
Expand Down
53 changes: 35 additions & 18 deletions texk/web2c/luatexdir/luaffi/ffi.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,27 @@ extern "C" {

#if __STDC_VERSION__+0 >= 199901L

#if ( defined( _WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__))
/* We should include something equivalent to */
/* complex.h */
/* e.g. Mingw GCC >=10 should have complex functions builtin */
/* and we can check them with the macro __has_include */
#if (__GNUC__ >= 10)
# if defined __has_include
# if __has_include (<complex.h>)
# include <complex.h>
# define HAVE_COMPLEX
# define HAVE_LONG_DOUBLE
# endif
# endif
#endif
#else
#include <complex.h>
#define HAVE_COMPLEX
#define HAVE_LONG_DOUBLE

#endif
#endif


#ifndef NDEBUG
#define DASM_CHECKS
Expand Down Expand Up @@ -121,13 +137,18 @@ struct jit;
#if defined ARCH_X86 || defined ARCH_X64
#define ALLOW_MISALIGNED_ACCESS
#endif
#ifdef OS_WIN
#define ALWAYS_INLINE __forceinline
#elif defined(__GNUC__)
#define ALWAYS_INLINE __attribute__ ((always_inline))
#else

/* #ifdef OS_WIN */
/* #define ALWAYS_INLINE __forceinline */
/* #elif defined(__GNUC__) */
/* #define ALWAYS_INLINE __attribute__ ((always_inline)) */
/* #else */
/* #define ALWAYS_INLINE inline */
/* #endif */

#define ALWAYS_INLINE inline
#endif


EXTERN_C EXPORT int luaopen_ffi(lua_State* L);

static int lua_absindex2(lua_State* L, int idx) {
Expand Down Expand Up @@ -463,18 +484,12 @@ static ALWAYS_INLINE complex_float mk_complex_float(double real, double imag) {
return real + imag * 1i;
}
#endif
/* static ALWAYS_INLINE complex_double mk_complex_double(double real, double imag) { */
/* return (complex_double){real , imag }; */
/* } */
/* static ALWAYS_INLINE complex_float mk_complex_float(double real, double imag) { */
/* return (complex_float){real , imag}; */
/* } */


extern float cimagf(complex_float);
extern float crealf(complex_float);
extern double cimag(complex_double);
extern double creal(complex_double);
/* AlpineLinux musl doesn't like them */
/* extern float cimagf(complex_float); */
/* extern float crealf(complex_float); */
/* extern double cimag(complex_double); */
/* extern double creal(complex_double); */


#if defined(OS_ANDROID) && __ANDROID_API__<26
Expand Down Expand Up @@ -514,6 +529,7 @@ static ALWAYS_INLINE complex_double mk_complex_double(double real, double imag)
static ALWAYS_INLINE complex_float mk_complex_float(double real, double imag) {
return (complex_float){ real, imag };
}

static ALWAYS_INLINE double creal(complex_double c) {
return c.real;
}
Expand Down Expand Up @@ -544,6 +560,7 @@ static complex_double cpow(complex_double f, complex_double s) {
r = exp(f.real);
return (complex_double) {r*cos(f.imag),r*sin(f.imag)};
}

#endif

#define CALLBACK_FUNC_USR_IDX 1
Expand Down
4 changes: 2 additions & 2 deletions texk/web2c/luatexdir/luatex.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
*/

int luatex_version = 120;
int luatex_revision = '0';
const char *luatex_version_string = "1.20.0";
int luatex_revision = '1';
const char *luatex_version_string = "1.20.1";
const char *engine_name = my_name;

#include <kpathsea/c-ctype.h>
Expand Down
2 changes: 1 addition & 1 deletion texk/web2c/luatexdir/luatex_svnversion.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
#define luatex_svn_revision 7635
#define luatex_svn_revision 7636
#endif

0 comments on commit d949c9c

Please sign in to comment.