\r
/** The type va_list is a type suitable for holding information needed by the\r
macros va_start, va_arg, and va_end.\r
-\r
- This implementation aliases va_list to VA_LIST, declared in MdePkg/Base.h.\r
**/\r
+#if defined(__GNUC__)\r
+typedef __builtin_va_list va_list;\r
+#else\r
#define va_list VA_LIST\r
+#endif\r
\r
/** The va_start macro shall be invoked before any access to the unnamed arguments.\r
The va_start macro initializes ap for subsequent use by va_arg and va_end.\r
is not compatible with the type that results after\r
application of the default argument promotions, the\r
behavior is undefined.\r
-\r
- This implementation aliases va_start to VA_START, declared in MdePkg/Base.h.\r
**/\r
-//#define va_start(ap, ParamN) VA_START(ap, ParamN)\r
+#if defined(__GNUC__)\r
+#define va_start __builtin_va_start\r
+#else\r
#define va_start VA_START\r
+#endif\r
\r
/** The va_arg macro expands to an expression that has the type and value of\r
the next argument in the call. The parameter ap shall be the same as the\r
va_start macro returns the value of the argument after that\r
specified by paramN. Successive invocations return the values\r
of the remaining arguments in succession.\r
-\r
- This implementation aliases va_arg to VA_ARG, declared in MdePkg/Base.h.\r
**/\r
-//#define va_arg(ap, type) VA_ARG(ap, type)\r
+#if defined(__GNUC__)\r
+#define va_arg __builtin_va_arg\r
+#else\r
#define va_arg VA_ARG\r
+#endif\r
\r
/** The va_end macro facillitates a normal return from the function whose\r
variable argument list was referred to by the expansion of va_start that\r
\r
@param ap An object of type va_list, initialized by a prior\r
invocation of va_start, that will no longer be referenced.\r
-\r
- This implementation aliases va_end to VA_END, declared in MdePkg/Base.h.\r
**/\r
-//#define va_end(ap) VA_END(ap)\r
+#if defined(__GNUC__)\r
+#define va_end __builtin_va_end\r
+#else\r
#define va_end VA_END\r
+#endif\r
\r
/** For BSD compatibility. **/\r
+#if defined(__GNUC__)\r
+#define va_copy __builtin_va_copy\r
+#else\r
#define va_copy(s,d) (s) = (d)\r
+#endif\r
\r
#endif /* _STDARG_H */\r