Skip to content

Commit

Permalink
Update stdarg.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Feb 16, 2020
1 parent 7f05cf3 commit 2a21662
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/std/stdarg.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
/*
* Copyright (C) 1999-2008 by Zilog, Inc.
* All Rights Reserved
*/
#ifndef STDARG_H
#define STDARG_H
#ifndef _STDARG_H
#define _STDARG_H

typedef char * va_list;
#define _INTSIZEOF(n) (sizeof(n) + sizeof(int)-1-((sizeof(n)-1)%sizeof(int)))
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef __builtin_va_list __gnuc_va_list;
#endif /* __GNUC_VA_LIST */

#define va_start(ap, parm) (ap = (char *)&parm + _INTSIZEOF(parm))
#define va_arg(ap,type) (*(type *)((ap += _INTSIZEOF(type)) - _INTSIZEOF(type)))
#define va_end(ap)
#ifndef _VA_LIST
#define _VA_LIST
typedef __builtin_va_list va_list;
#endif /* _VA_LIST */

#endif
#define va_start(ap, param) __builtin_va_start(ap, param)
#define va_end(ap) __builtin_va_end(ap)
#define va_arg(ap, type) __builtin_va_arg(ap, type)
#define __va_copy(dest, src) __builtin_va_copy(dest, src)
#if __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
# define va_copy(dest, src) __builtin_va_copy(dest, src)
#endif /* __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L */

#endif /* _STDARG_H */

0 comments on commit 2a21662

Please sign in to comment.