Varargs.h

Go to the documentation of this file.
00001 /* @(#)root/base:$Id: Varargs.h 20877 2007-11-19 11:17:07Z rdm $ */
00002 
00003 /*************************************************************************
00004  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00005  * All rights reserved.                                                  *
00006  *                                                                       *
00007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00009  *************************************************************************/
00010 
00011 #ifndef ROOT_Varargs
00012 #define ROOT_Varargs
00013 
00014 #ifdef __CINT__
00015 #include <stdarg.h>
00016 #endif
00017 
00018 #if defined(sparc) && defined(__CC_ATT301__)
00019 
00020    extern "C" __builtin_va_arg_incr(...);
00021    typedef char *va_list;
00022 #   define va_end(ap)
00023 #   define va_start(ap, parmN) ap= (char*)(&parmN+1)
00024 #   define va_arg(ap, mode) ((mode*) __builtin_va_arg_incr((mode*)ap))[0]
00025 #   define va_(arg) __builtin_va_alist
00026 
00027 #   include <stdio.h>
00028 
00029    extern "C" {
00030       int vfprintf(FILE*, const char *fmt, va_list ap);
00031       char *vsprintf(char*, const char *fmt, va_list ap);
00032    };
00033 
00034 #else
00035 #   ifndef __CINT__      
00036 #   include <stdarg.h>
00037 #   endif
00038 #   if defined(sparc) && !defined(__GNUG__) && !defined(__CC_SUN21__) && !defined(__SVR4)
00039 #      define va_(arg) __builtin_va_alist
00040 #   else
00041 #      define va_(arg) arg
00042 #   endif
00043 
00044 #endif
00045 
00046 #if !defined(R__VA_COPY)
00047 #  if defined(__GNUC__) && !defined(__FreeBSD__)
00048 #     define R__VA_COPY(to, from) __va_copy((to), (from))
00049 #  elif defined(__va_copy)
00050 #     define R__VA_COPY(to, from) __va_copy((to), (from))
00051 #  elif defined(va_copy)
00052 #     define R__VA_COPY(to, from) va_copy((to), (from))
00053 #  elif defined (R__VA_COPY_AS_ARRAY)
00054 #     define R__VA_COPY(to, from) memmove((to), (from), sizeof(va_list))
00055 #  elif defined(_WIN32) && _MSC_VER < 1310
00056 #     define R__VA_COPY(to, from) (*(to) = *(from))
00057 #  else
00058 #     define R__VA_COPY(to, from) ((to) = (from))
00059 #  endif
00060 #endif
00061 
00062 #endif

Generated on Tue Jul 5 14:10:35 2011 for ROOT_528-00b_version by  doxygen 1.5.1