b311480e |
1 | // Created on: 1999-12-30 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 1999-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | // Defines common framework for declaration of main/WinMain functions |
23 | // for executbales on UNIX and WNT that extends DRAW Test Harness. |
24 | |
25 | // In order to create executable in DRAW environment, in the executable |
26 | // the following line should be added: |
27 | // DRAW_MAIN |
28 | |
29 | #ifndef Draw_Main_HeaderFile |
30 | #define Draw_Main_HeaderFile |
31 | |
32 | #ifndef _Standard_TypeDef_HeaderFile |
33 | #include <Standard_TypeDef.hxx> |
34 | #endif |
35 | |
36 | #include <Draw_Appli.hxx> |
37 | #include <Standard_PCharacter.hxx> |
38 | |
39 | typedef void (*FDraw_InitAppli)(Draw_Interpretor&); |
40 | |
41 | #ifndef WNT |
42 | Standard_EXPORT Standard_Integer _main_ (Standard_Integer argc, |
43 | Standard_PCharacter argv[], |
44 | const FDraw_InitAppli Draw_InitAppli); |
45 | #else |
46 | #include <windows.h> |
47 | Standard_EXPORT Standard_Integer _WinMain_ (HINSTANCE hInstance, |
48 | HINSTANCE hPrevinstance, |
49 | LPSTR lpCmdLine, |
50 | Standard_Integer nCmdShow, |
51 | const FDraw_InitAppli Draw_InitAppli); |
52 | |
53 | Standard_EXPORT Standard_Integer _main_ (int argc, |
54 | char* argv[], |
55 | char* envp[], |
56 | const FDraw_InitAppli Draw_InitAppli); |
57 | #endif |
58 | |
59 | // Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain |
60 | #ifndef WNT |
61 | // main() |
62 | #define DRAW_MAIN int main (Standard_Integer argc, char* argv[])\ |
63 | {return _main_ (argc, argv, Draw_InitAppli);} |
64 | #else |
65 | // WinMain() and main() |
66 | #define DRAW_MAIN Standard_Integer PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance, LPSTR lpCmdLine, Standard_Integer nCmdShow)\ |
67 | {return _WinMain_ (hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli);}\ |
68 | \ |
69 | int main (int argc, char* argv[], char* envp[])\ |
70 | {return _main_ (argc, argv, envp, Draw_InitAppli);} |
71 | #endif |
72 | |
73 | |
74 | #endif |