comparison dw.h @ 2864:939fbceec13f

Win: Add support for building the C++ dwtestoo with Visual C. Need to use dwmain() macro instead of standard main() entrypoint for Windows. Had to move the _dw_convertargs() definition outside of the dwmain() macro. The macro can be called from C++ code changing the function definition.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 17 Dec 2022 01:50:26 +0000
parents 7479ab54e014
children 761b7a12b079
comparison
equal deleted inserted replaced
2863:f0a00c7c4ec1 2864:939fbceec13f
1947 _dw_main_thread(argc, argv); } \ 1947 _dw_main_thread(argc, argv); } \
1948 int _dwmain(a, b) 1948 int _dwmain(a, b)
1949 #elif defined(__WIN32__) 1949 #elif defined(__WIN32__)
1950 #define dwmain(a, b) \ 1950 #define dwmain(a, b) \
1951 _dwmain(a, b); \ 1951 _dwmain(a, b); \
1952 char ** API _dw_convertargs(int *count, char *start, HINSTANCE hInstance); \
1953 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {\ 1952 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {\
1954 int argc; \ 1953 int argc; \
1955 char **argv = _dw_convertargs(&argc, lpCmdLine, hInstance); \ 1954 char **argv = _dw_convertargs(&argc, lpCmdLine, hInstance); \
1956 return _dwmain(argc, argv); } \ 1955 return _dwmain(argc, argv); } \
1957 int _dwmain(a, b) 1956 int _dwmain(a, b)
2246 int API dw_feature_get(DWFEATURE feature); 2245 int API dw_feature_get(DWFEATURE feature);
2247 int API dw_feature_set(DWFEATURE feature, int state); 2246 int API dw_feature_set(DWFEATURE feature, int state);
2248 /* Exported for language bindings */ 2247 /* Exported for language bindings */
2249 void API _dw_init_thread(void); 2248 void API _dw_init_thread(void);
2250 void API _dw_deinit_thread(void); 2249 void API _dw_deinit_thread(void);
2250 /* Exported for WinMain handing macro on Windows */
2251 #ifdef __WIN32__
2252 char ** API _dw_convertargs(int *count, char *start, HINSTANCE hInstance);
2253 #endif
2251 2254
2252 #ifdef __cplusplus 2255 #ifdef __cplusplus
2253 } 2256 }
2254 #endif 2257 #endif
2255 2258