Skip to content

Instantly share code, notes, and snippets.

@domeniko-gentner
Created June 8, 2018 19:55
Show Gist options
  • Save domeniko-gentner/598f6166df7d7f130a6d5fbf69d16c16 to your computer and use it in GitHub Desktop.
Save domeniko-gentner/598f6166df7d7f130a6d5fbf69d16c16 to your computer and use it in GitHub Desktop.
Cross platform main/WinMain combo
//-----------------------------------------------------------------
int main(int argc, char** argv)
//-----------------------------------------------------------------
{
// Continue as usual...
}
#ifdef _WINDOWS
#include "Windows.h"
//-----------------------------------------------------------------
int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine, _In_ int nCmdShow)
//-----------------------------------------------------------------
{
return main(__argc, __argv);
}
#endif // #ifdef _WINDOWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment