]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/stdarg.h
Add Socket Libraries.
[mirror_edk2.git] / StdLib / Include / stdarg.h
index 226e3156951bdc0dd63524f47f4a72113aeb73cc..b966a5ce2b24016d43e96d2afa5c56884028e20a 100644 (file)
@@ -41,10 +41,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \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
 /** 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
 **/\r
+#if defined(__GNUC__)\r
+typedef __builtin_va_list   va_list;\r
+#else\r
 #define va_list   VA_LIST\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
 \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
@@ -63,11 +65,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                     is not compatible with the type that results after\r
                     application of the default argument promotions, the\r
                     behavior is undefined.\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
 **/\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
 #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
 \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
@@ -90,11 +93,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                   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
                   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
 **/\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
 #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
 /** 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
@@ -109,13 +113,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \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
     @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
 **/\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
 #define va_end              VA_END\r
+#endif\r
 \r
 /** For BSD compatibility. **/\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
 #define va_copy(s,d)      (s) = (d)\r
+#endif\r
 \r
 #endif  /* _STDARG_H */\r
 \r
 #endif  /* _STDARG_H */\r