Wednesday, November 17, 2004

#define variable arguments

Since #define does not take variable arguments you have to work around using function pointers.

void __format_out(const char* fmt, ...);

typedef void (*ptr2Fn) (const char* fmt, ...) ;

ptr2Fn _storeLine(int nSeverity,int lineNumber,char* fileName);

#define CTRACE _storeLine(40,__LINE__,__FILE__)

ptr2Fn _storeLine(int nPSeverity,int nPlineNumber,char* szPfileName)

nSeverity = nPSeverity;
szfileName = (char*)szPfileName;

return __format_out;
inline void __format_out(const char * fmt, ...)

CString ___str;
va_list marker;
va_start(marker, fmt);
___str.FormatV(A2T(fmt), marker);


TRACE("nUMBER IS %d",223);

No comments:

Install/Upgrade NVIDI Driver in Ubuntu for CUDA SDK

Most linux distribution comes with the Nouveau display driver configured. If you need to use NVIDIA...