Omgili - forum search, search forums  
  

Discussions about variadic macros

Displaying 1 - 10 out of 630 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I've run into a little theoretical problem. In a piece of code I'm maintaining there's a set of macros like #define MAX_OF_2(a, b) (a) > (b) ? (a) : (b) #define MAX_OF_3(a, b, c) MAX_OF_2(MAX_OF_2(a, b), c) #define MAX_OF_4(a, b, c, d) MAX_OF_2(MAX...
Started by on , 6 posts by 6 people.  
It is, however, a variadic MAX_OF_N macro: #include <iostream> #include not sure ....
The only code that I've seen do something like this was not variadic, but used works for one type.
It to recursively define macros.
Hi, I was wondering if it is possible to iterate over arguments passed to a variadic macro in C99 or using any GCC extensions ? For e.g. is it possible to write a generic macro that takes a structure and its fields passed as arguments and prints offset...
Started by on , 6 posts by 5 people.  
#include <stddef.h> // offsetof....
Struct, a, c); return 0; } If your structure is described with X-Macros , then it is possible to write a function, or a macro to iterate over all the fields of the structure and print their offset.
Hi, Is it possible to add default arguments before variable argument in variadic macro? e.g I have the version of macro something like #define MACRO(arg1, ...) func(arg1, ##__VA_ARGS__) I would like to add 2 more default arguments in the macro before ...
Started by on , 3 posts by 3 people.  
#define MACRO(arg1, ...) func(arg1, "", "", ##__VA_ARGS__) #define MACRO2(arg1, arg2.
To have two macros or three if you to be able to specify arg2 and use arg3 default value, but this is error-prone.
Ask your Facebook Friends
On Sat, 17 Dec 2011 12:45:26 -0800 (PST), lcaminiti <lorcaminiti@gmail.com Hello all, Why does Boost.Preprocessor redefines BOOST_PP_VARIAIDCS instead of just using BOOST_NO_VARIADIC_MACROS from Boost.Config? Furthermore, GCC supports variadics...
Started by on , 7 posts by 4 people.  
Answer Snippets (Read the full thread at omgili):
BOOST_PP_VARIADICS macro, I could do: #include <config.hpp#ifndef BOOST_NO_VARIADIC_MACROS #define BOOST_PP_NO_VARIADICS_VARIADICS....
Requires more than just superficial variadic macro support.
In C, is it possible to forward the invocation of a variadic function? As in, int my_printf(char *fmt, ...) { fprintf(stderr, "Calling printf with fmt %s", fmt); return SOMEHOW_INVOKE_LIBC_PRINTF; } Forwarding the invocation in the manner above obviously...
Started by on , 9 posts by 9 people.  
There isn't a way to directly call a variadic function in the standard library)....
And it always relied on esoteric implementation-specific macros, with the vital va_copy() macro only the vprintf version rather than plain printf .
Hi there. I was wondering if there was any way to pass parameters dynamically to variadic functions. i.e. If I have a function int some_function (int a, int b, ...){/*blah*/} and I am accepting a bunch of values from the user, I want some way of passing...
Started by on , 5 posts by 5 people.  
To a va_list (using macros from stdarg.h ) and calls its va_listIt might be interesting to try just passing an array, and then use the vararg macros anyway;pos[3] = 4; args->pos[4] = 5;....
The variadic version just converts ...
Below is code which includes a variadic function and calls to the variadic function. I would expect that it would output each sequence of numbers appropriately. It does when compiled as a 32-bit executable, but not when compiled as a 64-bit executable...
Started by on , 6 posts by 6 people.  
When the 4th argument is passed into the variadic function problems if a 64-bit value is pushed into the variadic function? What do the standards say about a 64-bit value, and extract two 3....
Windows, and a 64-bit value on 64-bit Windows.
I have approximately 30 variadic functions. Each one accepts a path as the final argument, i.e.: bool do_foo(struct *f, int q, const char *fmt, ...) In each function, I have to check that the expanded format is less then or equal to a certain size. So...
Started by on , 4 posts by 4 people.  
In general, if you're writing variadic functions (....
See the comp.lang.c FAQ.
Use variadic macros - like this: #define FOO(...) do { do_some_checks; myfun(__VA_ARGS__); } while (0) NB! Variadic macros are C99-only .
On Sat, 20 Nov 2010 14:07:25 -0500, Edward Diener <eldiener@tropicsoft.com Why is there two mutually exclusive macros indicating variadic template support for gcc ? There is the established BOOST_NO_VARIADIC_TEMPLATES which says that any compiler...
Started by on , 13 posts by 4 people.  
Answer Snippets (Read the full thread at omgili):
In fact an empty compiler config file_ macros neither BOOST_HAS_VARIADIC_TMPL nor BOOST_HAS_RVALUE_REFS will be defined therefore causing in which case variadic....
To promote use of variadic templates depending on that macro.
On Wed, 24 Nov 2010 09:22:30 +0100, Mathias Gaunard <mathias.gaunard@ens-lyon.org Variadic macros would allow to support tuples better in Boost.PP, as it would not be necessary to specify the size of the tuple, and it could be possible to provide...
Started by on , 11 posts by 4 people.  
Answer Snippets (Read the full thread at omgili):
The macro takes a "variadic" sequence and yields:17:45 -0500,....
Library to the sandbox which can use variadic macros and uses my variadic_macro_data library parentheses, it wraps them all in extra parentheses.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost