This is the code that I have been using:
// completely exit the app
#ifdef AGKWINDOWS
PostQuitMessage(0);
#endif
#ifdef AGKIOS
// forcing a quit in iOS is against recommended guidelines - use HOME button
// the exit button is disabled on AGKIOS builds
// but if you want to do so, this is the code
agk::MasterReset();
exit(0);
#endif
#ifdef IDE_ANDROID
// similar to iOS, an exit button should not be done
// but if you want to do so, this is the code
agk::MasterReset();
exit(0);
#endif
#ifdef IDE_MAC
glfwCloseWindow();
#endif
I last tested in in Windows, Mac and iOS using AppGameKit V2 11, I think.
The code is set to detect the AppGameKit type.
I use the same 50+ pairs of .cpp/.h files for all platforms.
Cheers,
Ancient Lady