Warnings on vc14 were eliminated
[occt.git] / src / Draw / Draw_Main.hxx
1 // Created on: 1999-12-30
2 // Created by: data exchange team
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 // Defines common framework for declaration of main/WinMain functions 
18 // for executbales on UNIX and WNT that extends DRAW Test Harness.
19
20 // In order to create executable in DRAW environment, in the executable
21 // the following line should be added:
22 // DRAW_MAIN
23
24 #ifndef Draw_Main_HeaderFile
25 #define Draw_Main_HeaderFile
26
27 #include <Standard_TypeDef.hxx>
28 #include <Draw_Appli.hxx>
29 #include <Standard_PCharacter.hxx>
30
31 typedef void (*FDraw_InitAppli)(Draw_Interpretor&);
32
33 #ifndef _WIN32
34 Standard_EXPORT Standard_Integer _main_ (Standard_Integer argc, 
35                                          Standard_PCharacter argv[], 
36                                          const FDraw_InitAppli Draw_InitAppli);
37 #else
38 #include <windows.h>
39 Standard_EXPORT Standard_Integer _WinMain_ (HINSTANCE hInstance, 
40                                             HINSTANCE hPrevinstance, 
41                                             LPSTR lpCmdLine, 
42                                             Standard_Integer nCmdShow,
43                                             const FDraw_InitAppli Draw_InitAppli);
44
45 Standard_EXPORT Standard_Integer _main_ (int argc, 
46                                          char* argv[], 
47                                          char* envp[], 
48                                          const FDraw_InitAppli Draw_InitAppli);
49 #endif
50
51 // Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain
52 #ifndef _WIN32
53 // main()
54 #define DRAW_MAIN int main (Standard_Integer argc, char* argv[])\
55 {return _main_ (argc, argv, Draw_InitAppli);}
56 #else
57 // WinMain() and main()
58 #define DRAW_MAIN Standard_Integer PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance, LPSTR lpCmdLine, Standard_Integer nCmdShow)\
59 {return _WinMain_ (hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli);}\
60 \
61 int main (int argc, char* argv[], char* envp[])\
62 {return _main_ (argc, argv, envp, Draw_InitAppli);}  
63 #endif
64
65
66 #endif