m01_C_aux - Technion 11 MACRO examples # if...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright 1995 - 2007 C. Gotsman & Y.M. Kimchi Computer Science Dept. Technion 234122 תמ מ Advanced C Page 1 For personal use only bEgInSlIdE Copyright 1995 - 2007 C. Gotsman & Y.M. Kimchi, Computer Science Dept. Technion Predefined Macros GCC: __GNUC__ __STRICT_ANSI__ (When strict ANSI applied) __linux__ (On linux systems) __FreeBSD__ (Another variant of unix) __hp9000s700__ (HP workstations) CL (VC++): WIN32, _WINDOWS, _MSC_VER (Version number) NDEBUG (Release version) DEBUG, _DEBUG (Debug version) bEgInSlIdE Copyright 1995 - 2007 C. Gotsman & Y.M. Kimchi, Computer Science Dept. Technion 10 Malloc / Free Macros #ifdef _DEBUG VoidPtr XXXXMalloc(unsigned Size, char *ObjType, char *FileName, int LineNum); #define XXXXMalloc(x) XXXXMalloc((x), #x, \ __FILE__, __LINE__) void XXXXFree(VoidPtr p); #define XXXXFree(x) { XXXXFree(x); x = NULL; } #else #define XXXXMalloc(Size) malloc(Size) #define XXXXFree(Ptr) free(Ptr) #endif /* _DEBUG */ bEgInSlIdE Copyright 1995 - 2007 C. Gotsman & Y.M. Kimchi, Computer Science Dept.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Technion 11 MACRO examples # if defined(OSF1DEC) || defined(sgi) || defined(SUN4) || \ defined(OS2GCC) || defined(__FreeBSD__) # ifdef OSF1DEC # ifdef _XOPEN_SOURCE # undef _XOPEN_SOURCE /* For usleep */ # endif /* _XOPEN_SOURCE */ # endif /* OSF1DEC */ # include <unistd.h> # endif /* OSF1DEC || sgi || SUN4 || OS2GCC || FreeBSD */ # ifdef __WINNT__ # include <direct.h> # if _MSC_VER >= 1400 /* Visual 8, 2005 */ # define mkdir(Dir, Permit) _mkdir(Dir) # else # define mkdir(Dir, Permit) mkdir(Dir) # endif /* _MSC_VER >= 1400 */ # endif /* __WINNT__ */ bEgInSlIdE Copyright 1995 - 2007 C. Gotsman & Y.M. Kimchi, Computer Science Dept. Technion memcpy C function void *memcpy(void *dest, const void *src, int count); 12 bEgInSlIdE Copyright 1995 - 2007 C. Gotsman & Y.M. Kimchi, Computer Science Dept. Technion qsort C function void qsort(void *base_array, int num_elem, size_elem, int (*compare )(const void *, const void *)); 13...
View Full Document

This note was uploaded on 04/14/2011 for the course CS 234122 taught by Professor Gillbarequet during the Spring '11 term at Technion.

Ask a homework question - tutors are online