1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

libnyquist: Add support for BSD operating systems

Signed-off-by: Sol Fisher Romanoff <sol@solfisher.com>
This commit is contained in:
Sol Fisher Romanoff 2021-08-29 16:42:15 +03:00
parent eae754b10b
commit 61898cfbd6
No known key found for this signature in database
GPG Key ID: 0E0ACA5D1C244E1F
2 changed files with 16 additions and 5 deletions

View File

@ -39,7 +39,8 @@
*/ */
#define nyquist_printf printf #define nyquist_printf printf
#if __APPLE__ && __GNUC__ /* Mac OS X */ /* BSD, macOS and other Unixes */
#if __APPLE__ || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define NEED_ULONG 1 #define NEED_ULONG 1
#else #else
#include <sys/types.h> #include <sys/types.h>

View File

@ -21,7 +21,7 @@ extern "C" {
#endif #endif
#include <stdlib.h> /* needed for getenv(); note that this was a problem #include <stdlib.h> /* needed for getenv(); note that this was a problem
for PMAX implementation, but I assume PMAX is obsolete now. for PMAX implementation, but I assume PMAX is obsolete now.
- RBD 16apr04 */ - RBD 16apr04 */
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
@ -55,7 +55,7 @@ extern "C" {
// #define IFMT "%ld" // #define IFMT "%ld"
// #endif // #endif
/* #define SAVERESTORE */ /* #define SAVERESTORE */
#define XL_LITTLE_ENDIAN #define XL_LITTLE_ENDIAN
#define _longjmp longjmp #define _longjmp longjmp
#define _setjmp setjmp #define _setjmp setjmp
#endif #endif
@ -188,6 +188,16 @@ extern long ptrtoabs();
#endif #endif
#endif #endif
/* BSD */
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <stdint.h>
#if defined(__LITTLE_ENDIAN__)
#define XL_LITTLE_ENDIAN
#else
#define XL_BIG_ENDIAN
#endif
#endif
/* default important definitions */ /* default important definitions */
#ifndef NNODES #ifndef NNODES
#define NNODES 1000 #define NNODES 1000
@ -283,7 +293,7 @@ extern long ptrtoabs();
#define FT_OBCLASS 14 #define FT_OBCLASS 14
#define FT_OBSHOW 15 #define FT_OBSHOW 15
#define FT_OBISA 16 #define FT_OBISA 16
/* macro to push a value onto the argument stack */ /* macro to push a value onto the argument stack */
#define pusharg(x) {if (xlsp >= xlargstktop) xlargstkoverflow();\ #define pusharg(x) {if (xlsp >= xlargstktop) xlargstkoverflow();\
*xlsp++ = (x);} *xlsp++ = (x);}
@ -337,7 +347,7 @@ void dbg_gc_xlsave(LVAL *n);
#define xlunbind(e) {for (; xldenv != (e); xldenv = cdr(xldenv))\ #define xlunbind(e) {for (; xldenv != (e); xldenv = cdr(xldenv))\
setvalue(car(car(xldenv)),cdr(car(xldenv)));} setvalue(car(car(xldenv)),cdr(car(xldenv)));}
/* type predicates */ /* type predicates */
#define atomp(x) ((x) == NIL || ntype(x) != CONS) #define atomp(x) ((x) == NIL || ntype(x) != CONS)
#define null(x) ((x) == NIL) #define null(x) ((x) == NIL)
#define listp(x) ((x) == NIL || ntype(x) == CONS) #define listp(x) ((x) == NIL || ntype(x) == CONS)