Using linkers predefined name
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma nodefaultlib
#pragma comment(linker, "/MERGE:.data=.text")
void __cdecl WinMainCRTStartup(void) // windows
//void __cdecl mainCRTStartup( void ) // console
{
ExitProcess(WinMain(GetModuleHandle(NULL), NULL, NULL, SW_NORMAL));
}
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
return 0;
}
Edit: added #pragma comment(linker, "/MERGE:.data=.text")