Advertisement
Kitomas

entry_point.h

Jul 21st, 2023
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | Source Code | 0 0
  1. //msvc doesn't seem to like me printing to stdout inside winmain,
  2. //so i'm doing this now lol
  3. #ifndef _ENTRY_POINT_H
  4. #define _ENTRY_POINT_H
  5.  
  6.  
  7.  
  8. #ifndef WINDOWS_LEAN_AND_MEAN
  9. # define WINDOWS_LEAN_AND_MEAN
  10. #  include <windows.h>
  11. # undef WINDOWS_LEAN_AND_MEAN
  12. #else
  13. #  include <windows.h>
  14. #endif
  15.  
  16.  
  17. #ifdef RELEASE_BUILD
  18. #define ENTRY_POINT(HINSTANCE_hInst, HINSTANCE_hPrevInst, LPSTR_args, int_nCmdShow) \
  19.   WinMain(HINSTANCE_hInst, HINSTANCE_hPrevInst, LPSTR_args, int_nCmdShow)
  20. #else
  21. #define ENTRY_POINT(HINSTANCE_hInst, HINSTANCE_hPrevInst, LPSTR_args, int_nCmdShow) \
  22.   _WinMain(HINSTANCE, HINSTANCE, LPSTR, int); \
  23.   int main(){ return _WinMain(GetModuleHandleA(NULL), NULL, GetCommandLineA(), SW_SHOW); } \
  24.   int WINAPI _WinMain(HINSTANCE_hInst, HINSTANCE_hPrevInst, LPSTR_args, int_nCmdShow)
  25. #endif
  26.  
  27.  
  28.  
  29. #endif /* _ENTRY_POINT_H */
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement