📄 subject_58212.htm
字号:
<p>
序号:58212 发表者:_长河_落日 发表日期:2003-10-30 18:47:05
<br>主题:请教一个简单问题!
<br>内容:以下是我的程序的一部分:编译提示 : error C2079: 'regs' uses undefined union '(void)check_PCI_BIOS::REGS'请教何故?哪里出了问题啊?<BR><BR>#include <ctype.h><BR>#include <dos.h><BR>#include <io.h><BR>#include <limits.h><BR>#include <stdio.h><BR>#include <stdlib.h><BR>#include <string.h><BR>#include <conio.h><BR><BR>......<BR><BR>static void determine_cfg_mech()<BR>{<BR> union REGS regs ;<BR>#if defined(__WATCOMC__) && defined(__386__)<BR> regs.w.ax = 0xB101 ;<BR> int386(0x1A,&regs,&regs) ;<BR>#else<BR> regs.x.ax = 0xB101 ;<BR> int86(0x1A,&regs,&regs) ;<BR>#endif /* __WATCOMC__ && __386__ */<BR> if (regs.h.ah == 0x00)<BR> {<BR> // we have a PCI BIOS, so check which configuration mechanism(s) it<BR> // supports<BR> int mechs = regs.h.al & 0x03 ;<BR> if (mechs & 0x01)<BR> cfg_mech = 1 ;<BR> else if (mechs & 0x02)<BR> cfg_mech = 2 ;<BR> else<BR> cfg_mech = 1 ; // default is to assume mechanism #1<BR> }<BR> return ;<BR>}<BR><BR>......
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:bottle_fish 回复日期:2003-10-31 08:29:08
<br>内容:REGS 没有定义
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:_长河_落日 回复日期:2003-10-31 12:44:57
<br>内容:我知道没定义,但是在VC6环境下有定义它的头文件吗?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:LuckGood 回复日期:2003-10-31 17:04:39
<br>内容:你用TC或者BC倒是有可能编译通过,TC/bc会有相应的头文件的。在VC6下面你不可能使用编译通过的,VC开发库里面好像就没有这些结构的存在了,更不用说中断之类的api了.我想即使生成了EXE文件,这个文件也不一定能在2000下面运行。<BR><BR>2003-10-31 17:10:52
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -