Can we have a nested function in C? What is the use of nested functions? If they exist in C does their implementation differ from compiler to compiler?
Or you can be smart about it and use the preprocessor in your advantage (source.c):
#ifndef FIRSTPASS
#include
//here comes your "nested" definitions
#define FIRSTPASS
#include "source.c"
#undef FIRSTPASS
main(){
#else
int global = 2;
int func() {printf("%d\n", global);}
#endif
#ifndef FIRSTPASS
func();}
#endif