# HG changeset patch # User schloegl # Date 1450780133 0 # Node ID 29b7963bf7485344f62ecba9d5ee0f4479ae413e # Parent 794b03395bbddc9fbbcbe4d54c80a8cf074fdb6f define typeof() when missing; support for clang compiler added diff -r 794b03395bbd -r 29b7963bf748 extra/NaN/src/Makefile --- a/extra/NaN/src/Makefile Tue Dec 22 00:48:47 2015 +0000 +++ b/extra/NaN/src/Makefile Tue Dec 22 10:28:53 2015 +0000 @@ -48,9 +48,9 @@ ifneq (Darwin,$(shell uname)) CFLAGS += -fopenmp MEX_OPTION += -lgomp +MEX_OPTION += CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS) " CXXFLAGS\#"$(CFLAGS) " endif -MEX_OPTION += CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS) " CXXFLAGS\#"$(CFLAGS) " MATMEX = $(MATLABDIR)/bin/mex $(MEX_OPTION) PROGS = histo_mex.mex covm_mex.mex kth_element.mex sumskipnan_mex.mex str2array.mex train.mex svmtrain_mex.mex svmpredict_mex.mex xptopen.mex diff -r 794b03395bbd -r 29b7963bf748 extra/NaN/src/covm_mex.cpp --- a/extra/NaN/src/covm_mex.cpp Tue Dec 22 00:48:47 2015 +0000 +++ b/extra/NaN/src/covm_mex.cpp Tue Dec 22 10:28:53 2015 +0000 @@ -54,6 +54,10 @@ */ #define ISNAN(a) (a!=a) +#ifndef typeof +#define typeof __typeof__ +#endif + void mexFunction(int POutputCount, mxArray* POutput[], int PInputCount, const mxArray *PInputs[]) { double *X0=NULL, *Y0=NULL, *W=NULL; diff -r 794b03395bbd -r 29b7963bf748 extra/NaN/src/sumskipnan_mex.cpp --- a/extra/NaN/src/sumskipnan_mex.cpp Tue Dec 22 00:48:47 2015 +0000 +++ b/extra/NaN/src/sumskipnan_mex.cpp Tue Dec 22 10:28:53 2015 +0000 @@ -58,6 +58,9 @@ */ #define ISNAN(a) (a!=a) +#ifndef typeof +#define typeof __typeof__ +#endif inline void __sumskipnan2w__(double *data, size_t Ni, double *s, double *No, char *flag_anyISNAN, double *W); inline void __sumskipnan3w__(double *data, size_t Ni, double *s, double *s2, double *No, char *flag_anyISNAN, double *W); diff -r 794b03395bbd -r 29b7963bf748 extra/NaN/src/xptopen.cpp --- a/extra/NaN/src/xptopen.cpp Tue Dec 22 00:48:47 2015 +0000 +++ b/extra/NaN/src/xptopen.cpp Tue Dec 22 10:28:53 2015 +0000 @@ -63,6 +63,10 @@ #include #include "mex.h" +#ifndef typeof +#define typeof __typeof__ +#endif + #ifdef tmwtypes_h #if (MX_API_VER<=0x07020000) typedef int mwSize;