Mercurial > hg > octave-lojdl
changeset 9651:7234534f47ba
mexproto.h: define OCTINTERP_API if it is not already defined
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 18 Sep 2009 05:51:13 -0400 |
parents | 6e2a3968ea6f |
children | ecdb275bd41b |
files | src/ChangeLog src/mexproto.h |
diffstat | 2 files changed, 39 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-09-18 John W. Eaton <jwe@octave.org> + + * mexproto.h: Define OCTINTERP_API if it is not already defined. + Use C-style comments. + 2009-09-16 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTIONS/rand.cc (Frandperm): New function.
--- a/src/mexproto.h +++ b/src/mexproto.h @@ -55,15 +55,26 @@ #include <stdlib.h> #endif +/* The definition of OCTINTERP_API is normally provided by Octave's + config.h file. This is provided for the case of mex.h included by + user programs that don't use Octave's config.h. */ +#if ! defined (OCTINTERP_API) +#if defined (_MSC_VER) +#define OCTINTERP_API __declspec(dllimport) +#else +/* All other compilers, at least for now. */ +#define OCTINTERP_API +#endif +#endif + #define MXARRAY_TYPEDEFS_ONLY #include "mxarray.h" #undef MXARRAY_TYPEDEFS_ONLY -// Interface to the interpreter. +/* Interface to the interpreter. */ extern OCTINTERP_API const char *mexFunctionName (void); -extern OCTINTERP_API int mexCallMATLAB (int nargout, mxArray *argout[], int nargin, - mxArray *argin[], const char *fname); +extern OCTINTERP_API int mexCallMATLAB (int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname); extern OCTINTERP_API void mexSetTrapFlag (int flag); extern OCTINTERP_API int mexEvalString (const char *s); @@ -89,23 +100,23 @@ extern OCTINTERP_API int mexSet (double handle, const char *property, mxArray *val); extern OCTINTERP_API void mexUnlock (void); -// Floating point predicates. +/* Floating point predicates. */ extern OCTINTERP_API int mxIsFinite (double v); extern OCTINTERP_API int mxIsInf (double v); extern OCTINTERP_API int mxIsNaN (double v); -// Floating point values. +/* Floating point values. */ extern OCTINTERP_API double mxGetEps (void); extern OCTINTERP_API double mxGetInf (void); extern OCTINTERP_API double mxGetNaN (void); -// Memory management. +/* Memory management. */ extern OCTINTERP_API void *mxCalloc (size_t n, size_t size); extern OCTINTERP_API void *mxMalloc (size_t n); extern OCTINTERP_API void *mxRealloc (void *ptr, size_t size); extern OCTINTERP_API void mxFree (void *ptr); -// Constructors. +/* Constructors. */ extern OCTINTERP_API mxArray *mxCreateCellArray (mwSize ndims, const mwSize *dims); extern OCTINTERP_API mxArray *mxCreateCellMatrix (mwSize m, mwSize n); extern OCTINTERP_API mxArray *mxCreateCharArray (mwSize ndims, const mwSize *dims); @@ -123,13 +134,13 @@ extern OCTINTERP_API mxArray *mxCreateStructArray (mwSize ndims, const mwSize *dims, int num_keys, const char **keys); extern OCTINTERP_API mxArray *mxCreateStructMatrix (mwSize rows, mwSize cols, int num_keys, const char **keys); -// Copy constructor. +/* Copy constructor. */ extern OCTINTERP_API mxArray *mxDuplicateArray (const mxArray *v); -// Destructor. +/* Destructor. */ extern OCTINTERP_API void mxDestroyArray (mxArray *v); -// Type Predicates. +/* Type Predicates. */ extern OCTINTERP_API int mxIsCell (const mxArray *ptr); extern OCTINTERP_API int mxIsChar (const mxArray *ptr); extern OCTINTERP_API int mxIsClass (const mxArray *ptr, const char *name); @@ -149,31 +160,31 @@ extern OCTINTERP_API int mxIsUint64 (const mxArray *ptr); extern OCTINTERP_API int mxIsUint8 (const mxArray *ptr); -// Odd type+size predicate. +/* Odd type+size predicate. */ extern OCTINTERP_API int mxIsLogicalScalar (const mxArray *ptr); -// Odd type+size+value predicate. +/* Odd type+size+value predicate. */ extern OCTINTERP_API int mxIsLogicalScalarTrue (const mxArray *ptr); -// Size predicate. +/* Size predicate. */ extern OCTINTERP_API int mxIsEmpty (const mxArray *ptr); -// Just plain odd thing to ask of a value. +/* Just plain odd thing to ask of a value. */ extern OCTINTERP_API int mxIsFromGlobalWS (const mxArray *ptr); -// Dimension extractors. +/* Dimension extractors. */ extern OCTINTERP_API size_t mxGetM (const mxArray *ptr); extern OCTINTERP_API size_t mxGetN (const mxArray *ptr); extern OCTINTERP_API mwSize *mxGetDimensions (const mxArray *ptr); extern OCTINTERP_API mwSize mxGetNumberOfDimensions (const mxArray *ptr); extern OCTINTERP_API size_t mxGetNumberOfElements (const mxArray *ptr); -// Dimension setters. +/* Dimension setters. */ extern OCTINTERP_API void mxSetM (mxArray *ptr, mwSize M); extern OCTINTERP_API void mxSetN (mxArray *ptr, mwSize N); extern OCTINTERP_API void mxSetDimensions (mxArray *ptr, mwSize *dims, mwSize ndims); -// Data extractors. +/* Data extractors. */ extern OCTINTERP_API double *mxGetPi (const mxArray *ptr); extern OCTINTERP_API double *mxGetPr (const mxArray *ptr); extern OCTINTERP_API double mxGetScalar (const mxArray *ptr); @@ -182,24 +193,24 @@ extern OCTINTERP_API void *mxGetData (const mxArray *ptr); extern OCTINTERP_API void *mxGetImagData (const mxArray *ptr); -// Data setters./ +/* Data setters. */ extern OCTINTERP_API void mxSetPr (mxArray *ptr, double *pr); extern OCTINTERP_API void mxSetPi (mxArray *ptr, double *pi); extern OCTINTERP_API void mxSetData (mxArray *ptr, void *data); extern OCTINTERP_API void mxSetImagData (mxArray *ptr, void *pi); -// Classes. +/* Classes. */ extern OCTINTERP_API mxClassID mxGetClassID (const mxArray *ptr); extern OCTINTERP_API const char *mxGetClassName (const mxArray *ptr); extern OCTINTERP_API void mxSetClassName (mxArray *ptr, const char *name); -// Cell support. +/* Cell support. */ extern OCTINTERP_API mxArray *mxGetCell (const mxArray *ptr, mwIndex idx); extern OCTINTERP_API void mxSetCell (mxArray *ptr, mwIndex idx, mxArray *val); -// Sparse support. +/* Sparse support. */ extern OCTINTERP_API mwIndex *mxGetIr (const mxArray *ptr); extern OCTINTERP_API mwIndex *mxGetJc (const mxArray *ptr); extern OCTINTERP_API mwSize mxGetNzmax (const mxArray *ptr); @@ -208,7 +219,7 @@ extern OCTINTERP_API void mxSetJc (mxArray *ptr, mwIndex *jc); extern OCTINTERP_API void mxSetNzmax (mxArray *ptr, mwSize nzmax); -// Structure support. +/* Structure support. */ extern OCTINTERP_API int mxAddField (mxArray *ptr, const char *key); extern OCTINTERP_API void mxRemoveField (mxArray *ptr, int key_num); @@ -227,7 +238,7 @@ extern OCTINTERP_API int mxGetString (const mxArray *ptr, char *buf, mwSize buflen); extern OCTINTERP_API char *mxArrayToString (const mxArray *ptr); -// Miscellaneous. +/* Miscellaneous. */ #ifdef NDEBUG #define mxAssert(expr, msg) \ do \