| 1 | // Copyright (c) Microsoft. All rights reserved. | 
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. | 
| 3 |  | 
| 4 | #include <stdarg.h> | 
| 5 | #include "native.h" | 
| 6 |  | 
| 7 |  | 
| 8 | MCC_API VType7 sum(double count1, int count2, __int64 count3, float count4, short count5, double count6, ...) { | 
| 9 |     int count = (int)count1 + (int)count2 + (int)count3 + (int)count4 + (int)count5 + (int)count6; | 
| 10 |     VType7 res; | 
| 11 |     va_list args; | 
| 12 |  | 
| 13 |     // zero out res | 
| 14 |     res.reset(); | 
| 15 |  | 
| 16 |     // initialize variable arguments. | 
| 17 |     va_start(args, count6); | 
| 18 |     for (int i = 0; i < count; ++i) { | 
| 19 |         VType7 val = va_arg(args, VType7); | 
| 20 |         res.add(val); | 
| 21 |     } | 
| 22 |     // reset variable arguments. | 
| 23 |     va_end(args); | 
| 24 |  | 
| 25 |     return res; | 
| 26 | } | 
| 27 |  |