main-func: implicitly save argc/argv in DEFINE_MAIN_FUNCTION() functions
Let's remove the risk of forgetting to save argc/argv if DEFINE_MAIN_FUNCTION() is used.
This commit is contained in:
@@ -8,10 +8,12 @@
|
||||
#include "spawn-ask-password-agent.h"
|
||||
#include "spawn-polkit-agent.h"
|
||||
#include "static-destruct.h"
|
||||
#include "util.h"
|
||||
|
||||
#define _DEFINE_MAIN_FUNCTION(intro, impl, ret) \
|
||||
int main(int argc, char *argv[]) { \
|
||||
int r; \
|
||||
save_argc_argv(argc, argv); \
|
||||
intro; \
|
||||
r = impl; \
|
||||
static_destruct(); \
|
||||
|
||||
Reference in New Issue
Block a user