/* 
 * $Id: stdarg.h.in,v 1.7 2002/03/05 09:35:24 a-hasega Exp $
 * $RWC_Release: Omni-1.6 $
 * $RWC_Copyright:
 *  Omni Compiler Software Version 1.5-1.6
 *  Copyright (C) 2002 PC Cluster Consortium
 *  
 *  This software is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License version
 *  2.1 published by the Free Software Foundation.
 *  
 *  Omni Compiler Software Version 1.0-1.4
 *  Copyright (C) 1999, 2000, 2001.
 *   Tsukuba Research Center, Real World Computing Partnership, Japan.
 *  
 *  Please check the Copyright and License information in the files named
 *  COPYRIGHT and LICENSE under the top  directory of the Omni Compiler
 *  Software release kit.
 *  
 *  
 *  $
 */
#ifndef __OMPCC_STDARG_H__
#define __OMPCC_STDARG_H__

unsigned __ompc_output(char [], ...);

#ifdef __PGI
#pragma __ompc_output #include "stdarg.h"
#else
#pragma __ompc_output #include <stdarg.h>
#endif

#ifdef __OMNI_OS_IRIX__
typedef char	*va_list;
#else /* __OMNI_OS_IRIX__ */
#ifdef __PGI
typedef char    *va_list;
#else /* __PGI */ 
typedef void    *va_list;
#endif /* __PGI */
#endif /* __OMNI_OS_IRIX__ */

#ifdef linux
typedef void	*__gnuc_va_list;
#endif

#define va_start(list,name)	(void) __ompc_output("va_start(%s, %s)", list, name)
#define	va_arg(list, mode)	((mode)__ompc_output("va_arg(%s, %t)", list, (mode)(0)))
#define va_copy(top, from)	(void) __ompc_output("va_copy(%s, %s)", to, from)

#ifdef __PGI
#define va_end(list)
#else /* __PGI */
#define va_end(list)            (void) __ompc_output("va_end(%s)", list)
#endif /* __PGI */

#endif
