Biomechanical Joint Model
 Author: Anderson Maciel

cm_macros.h

Go to the documentation of this file.
00001 #ifndef _CM_C_MACROS_H
00002 #define _CM_C_MACROS_H
00003 
00004 /* This is inspired by Sun's <c_varieties.h> header.
00005  * Revised         : Erik Erikson 4/29/92 - Added UNC_
00006  * Initial Version : Jon Leech 4/8/92
00007  *
00008  * EXTERN_FUNCTION - declare a function with argument types
00009  * Usage:
00010  *
00011  *  EXTERN_FUNCTION(int function_with_no_arguments, (_VOID_));
00012  *  EXTERN_FUNCTION(double normal_function, (int arg1, double arg2));
00013  *  EXTERN_FUNCTION(void varargs_function, (char *, DOTDOTDOT));
00014  *
00015  * FUNCTION_POINTER - declare a function pointer with argument types
00016  * Usage:
00017  *
00018  *  typedef struct {
00019  *      FUNCTION_POINTER(int (*insidefunc),(float f[3]));
00020  *  } obj;
00021  *
00022  *  EXTERN_FUNCTION(int read,(int fd, const char *buf, int len));
00023  *  FUNCTION_POINTER(int (*readwriteptr),(int,const char *,int)) = read;
00024  *
00025  */
00026 
00027 #if defined(__cplusplus)
00028 /* C++ */
00029 #define CM_FUNCTION_POINTER(ptr,args) ptr args
00030 #define CM_EXTERN_FUNCTION(func,args) extern "C" { func args; }
00031 #define CM_DOTDOTDOT ...
00032 #define CM__VOID_ void
00033 
00034 #elif defined(__STDC__)
00035 /* ANSI C */
00036 #define CM_FUNCTION_POINTER(ptr,args) ptr args
00037 #define CM_EXTERN_FUNCTION(func,args) func args
00038 #define CM_DOTDOTDOT
00039 #define CM__VOID_ void
00040 
00041 #else
00042 /* K&R C */
00043 #define CM_FUNCTION_POINTER(ptr,args) ptr()
00044 #define CM_EXTERN_FUNCTION(func,args) func()
00045 #define CM_DOTDOTDOT
00046 #define CM__VOID_
00047 
00048 #endif
00049 
00050 #endif /*_CM_C_MACROS_H*/
00051 
00052 
00053 
00054 
00055 

Generated on Thu Dec 1 10:13:32 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5