More explicit argument list for INVOKE_WCB callbacks

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1811 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2017-06-30 23:21:21 +00:00
parent da0b7b3369
commit f0150de08d
2 changed files with 12 additions and 5 deletions

View File

@ -713,7 +713,13 @@ do \
* typedef void (* FGCBEntryUC)( int, FGCBUserData ); * typedef void (* FGCBEntryUC)( int, FGCBUserData );
* #define EXPAND_WCB_SUB_Entry(args, userData) EXPAND_WCB_ONE_OR_MORE(args, userData) * #define EXPAND_WCB_SUB_Entry(args, userData) EXPAND_WCB_ONE_OR_MORE(args, userData)
*/ */
#define FG_COMPILER_SUPPORTS_VA_ARGS
#ifdef FG_COMPILER_SUPPORTS_VA_ARGS
#define EXPAND_WCB_UNPARAN(...) __VA_ARGS__ #define EXPAND_WCB_UNPARAN(...) __VA_ARGS__
#else
#error "Compiler does not support varadic argument macros"
#endif
#define EXPAND_WCB_ZERO(args, userData) ( userData ) #define EXPAND_WCB_ZERO(args, userData) ( userData )
#define EXPAND_WCB_ONE_OR_MORE(args, userData) ( EXPAND_WCB_UNPARAN args, userData ) #define EXPAND_WCB_ONE_OR_MORE(args, userData) ( EXPAND_WCB_UNPARAN args, userData )
@ -731,9 +737,10 @@ do \
* *
* The callback is invoked as: * The callback is invoked as:
* *
* callback( arg_list ); * callback( arg_list, userData );
* *
* ...so the parentheses are REQUIRED in the {arg_list}. * ...where userData is added to the arg_list, but the parentheses
* are REQUIRED in the {arg_list}.
* *
* NOTE that it does a sanity-check and also sets the * NOTE that it does a sanity-check and also sets the
* current window. * current window.