diff options
author | musil <tmusil@users.sourceforge.net> | 2012-09-06 16:01:18 +0000 |
---|---|---|
committer | musil <tmusil@users.sourceforge.net> | 2012-09-06 16:01:18 +0000 |
commit | 1bea477208d0966a035c0fc0a7187559d499b92f (patch) | |
tree | 8ea4996edb68c72365aae4a54eaf314e2eabbbaa /iemlib2 | |
parent | 33dd6d603830640766aa1a5fe70137c856e2c145 (diff) |
64 bit array access compatible
svn path=/trunk/externals/iemlib/; revision=16194
Diffstat (limited to 'iemlib2')
-rw-r--r-- | iemlib2/src/iemlib.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/iemlib2/src/iemlib.h b/iemlib2/src/iemlib.h index 973bfeb..8703127 100644 --- a/iemlib2/src/iemlib.h +++ b/iemlib2/src/iemlib.h @@ -1,12 +1,13 @@ /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. -iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2007 */ +iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2012 */ #ifndef __IEMLIB_H__ #define __IEMLIB_H__ +#define IS_A_NULL(atom,index) ((atom+index)->a_type == A_NULL) #define IS_A_POINTER(atom,index) ((atom+index)->a_type == A_POINTER) #define IS_A_FLOAT(atom,index) ((atom+index)->a_type == A_FLOAT) #define IS_A_SYMBOL(atom,index) ((atom+index)->a_type == A_SYMBOL) @@ -15,6 +16,8 @@ iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2007 * #define IS_A_SEMI(atom,index) ((atom+index)->a_type == A_SEMI) #define IS_A_COMMA(atom,index) ((atom+index)->a_type == A_COMMA) +#define SETNULL(atom) ((atom)->a_type = A_NULL) + /* now miller's code starts : for 4 point interpolation for lookup tables @@ -99,4 +102,17 @@ union tabfudge_f #endif +/* on 64bit systems we cannot use garray_getfloatarray... */ +#if (defined __x86_64__) && (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION >= 41) +# define iemarray_t t_word +# define iemarray_getarray garray_getfloatwords +# define iemarray_getfloat(pointer, index) (pointer[index].w_float) +# define iemarray_setfloat(pointer, index, fvalue) (pointer[index].w_float = fvalue) +#else +# define iemarray_t t_float +# define iemarray_getarray garray_getfloatarray +# define iemarray_getfloat(pointer, index) (pointer[index]) +# define iemarray_setfloat(pointer, index, fvalue) (pointer[index] = fvalue) +#endif + #endif |