src/win32.cpp
changeset 6124 9f822ae6c086
parent 6117 6507b2a7e71d
child 6165 9c245e46bb23
equal deleted inserted replaced
6123:04eb770ec17e 6124:9f822ae6c086
   866 	#define _OUT_TO_MSGBOX       2
   866 	#define _OUT_TO_MSGBOX       2
   867 	#define _REPORT_ERRMODE      3
   867 	#define _REPORT_ERRMODE      3
   868 	int _set_error_mode(int);
   868 	int _set_error_mode(int);
   869 #endif
   869 #endif
   870 
   870 
   871 #if defined(WINCE)
   871 #if defined(WINCE) && !defined(_tWinMain)
   872 int APIENTRY WinMain
   872 /* GCC crosscompiler for WINCE doesn't support wide version */
   873 #else
   873 # define _tWinMain WinMain
   874 int APIENTRY _tWinMain
   874 #endif /* WINCE */
   875 #endif
   875 
   876         (HINSTANCE hInstance, HINSTANCE hPrevInstance,
   876 int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
   877 	LPTSTR lpCmdLine, int nCmdShow)
   877 	LPTSTR lpCmdLine, int nCmdShow)
   878 {
   878 {
   879 	int argc;
   879 	int argc;
   880 	char *argv[64]; // max 64 command line arguments
   880 	char *argv[64]; // max 64 command line arguments
   881 	char *cmdline;
   881 	char *cmdline;
   920 }
   920 }
   921 
   921 
   922 #if defined(WINCE)
   922 #if defined(WINCE)
   923 void GetCurrentDirectoryW(int length, wchar_t *path)
   923 void GetCurrentDirectoryW(int length, wchar_t *path)
   924 {
   924 {
   925 	wchar_t *pDest = NULL;
       
   926 	/* Get the name of this module */
   925 	/* Get the name of this module */
   927 	GetModuleFileName(NULL, path, length);
   926 	GetModuleFileName(NULL, path, length);
   928 
   927 
   929 	/* Remove the executable name, this we call CurrentDir */
   928 	/* Remove the executable name, this we call CurrentDir */
   930 	pDest = wcsrchr(path, '\\');
   929 	wchar_t *pDest = wcsrchr(path, '\\');
   931 	if (pDest != NULL) {
   930 	if (pDest != NULL) {
   932 		int result = pDest - path + 1;
   931 		int result = pDest - path + 1;
   933 		path[result] = '\0';
   932 		path[result] = '\0';
   934 	}
   933 	}
   935 }
   934 }