]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Sample/Tools/Source/VcCheck/VcCheck.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / VcCheck / VcCheck.c
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 VcCheck.c\r
15\r
16Abstract:\r
17\r
18 We have found problems with the Visual C++ SP4 and the /O1 flag.\r
19 If this tests ask a question you have the wrong version of Visual C++\r
20 on your system\r
21\r
22 This test assumes the tools are being compiled with the same complier\r
23 as the Tiano code. \r
24\r
25 Please see $(EFI_SOURCE)\EFI2.0 Developer's Manual.doc to get the\r
26 correct version of Visual C++\r
27\r
28--*/\r
29\r
30#include <stdio.h>\r
31\r
32_int16 gGloba16;\r
33\r
34int\r
35CheckLostCode (\r
36 int Value\r
37 )\r
38/*++\r
39\r
40Routine Description:\r
41 This routine is used to test for compiler isseus with /O1.\r
42 If the /O1 compiler option, and C2.dll is got from Visual C++ SP5\r
43 (version: 6.00.8168.0), the assember codes after default branch will be\r
44 losted. (Execute "cl Visual Ccheck.c /O1 /FAsc" to get detail information)\r
45\r
46Arguments:\r
47 Value - Test case\r
48\r
49Returns: \r
50 Test to see if comiler error is present.\r
51\r
52--*/\r
53{\r
54 switch (Value) {\r
55 case 0:\r
56 break;\r
57\r
58 default:\r
59 _asm\r
60 {\r
61 mov bx, 1\r
62 mov gGloba16, bx\r
63 }\r
64\r
65 return 1;\r
66 }\r
67\r
68 _asm\r
69 {\r
70 mov bx, 0\r
71 mov gGloba16, bx\r
72 }\r
73\r
74 return 0;\r
75}\r
76\r
77int\r
78main (\r
79 void\r
80 )\r
81/*++\r
82\r
83Routine Description:\r
84 This utility is checking for a known Visual C++ compiler issues. To remove this \r
85 question from the build follow the steps in the developers manual.\r
86\r
87Arguments:\r
88 NONE\r
89\r
90Returns: \r
91 0 - Compiler version is O.K.\r
92 1 - Compiler version is Bad\r
93\r
94--*/\r
95{\r
96 int result;\r
97 char select;\r
98\r
99 gGloba16 = 0xFF;\r
100 result = 0;\r
101\r
102 CheckLostCode (0);\r
103 result += (gGloba16 == 0) ? 0 : 1;\r
104\r
105 CheckLostCode (1);\r
106 result += (gGloba16 == 1) ? 0 : 1;\r
107\r
108 if (result != 0) {\r
109 printf ("Warning: C2.dll is incorrect.\n Please see $(EFI_SOURCE)\\EFI2.0 Developer's Manual.doc for corrective action.\n");\r
110 printf ("Would you want to continue?(Y/N)");\r
111\r
112 scanf ("%c", &select);\r
113 if ((select == 'Y') || (select == 'y')) {\r
114 return 0;\r
115 } else {\r
116 return 1;\r
117 }\r
118 }\r
119\r
120 return 0;\r
121}\r