⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpopts.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 5 页
字号:
.note ok
enable control flow prologues and epilogues
:optref refid='SWok'.
.do end
.if &e'&$SWol eq 1 .do begin
.note ol
enable loop optimizations
:optref refid='SWol'.
.do end
.if &e'&$SWolpls eq 1 .do begin
.note ol+
enable loop optimizations with loop unrolling
:optref refid='SWolpls'.
.do end
.if &e'&$SWom eq 1 .do begin
.note om
generate in-line 80x87 code for math functions
:optref refid='SWom'.
.do end
.if &e'&$SWon eq 1 .do begin
.note on
allow numerically unstable optimizations
:optref refid='SWon'.
.do end
.if &e'&$SWoo eq 1 .do begin
.note oo
continue compilation if low on memory
:optref refid='SWoo'.
.do end
.if &e'&$SWop eq 1 .do begin
.note op
generate consistent floating-point results
:optref refid='SWop'.
.do end
.if &e'&$SWor eq 1 .do begin
.note or
reorder instructions for best pipeline usage
:optref refid='SWor'.
.do end
.if &e'&$SWos eq 1 .do begin
.note os
favor code size over execution time in optimizations
:optref refid='SWos'.
.do end
.if &e'&$SWot eq 1 .do begin
.note ot
favor execution time over code size in optimizations
:optref refid='SWot'.
.do end
.if &e'&$SWou eq 1 .do begin
.note ou
all functions must have unique addresses
:optref refid='SWou'.
.do end
.if &e'&$SWox eq 1 .do begin
.note ox
equivalent to -obmiler -s
:optref refid='SWox'.
.do end
.if &e'&$SWoz eq 1 .do begin
.note oz
NULL points to valid memory in the target environment
:optref refid='SWoz'.
.do end
.endnote
.*
.section C++ Exception Handling
.*
.begnote $compact $setptnt 10
.ix 'options' 'C++ exception handling'
.ix 'exception handling'
.notehd1 Option:
.notehd2 Description:
.*
.if &e'&$SWxd eq 1 .do begin
.note xd
disable exception handling (default)
:optref refid='SWxd'.
.do end
.*
.if &e'&$SWxdt eq 1 .do begin
.note xdt
disable exception handling (same as "xd")
:optref refid='SWxdt'.
.do end
.*
.if &e'&$SWxds eq 1 .do begin
.note xds
disable exception handling (table-driven destructors)
:optref refid='SWxds'.
.do end
.*
.if &e'&$SWxs eq 1 .do begin
.note xs
enable exception handling
:optref refid='SWxs'.
.do end
.*
.if &e'&$SWxst eq 1 .do begin
.note xst
enable exception handling (direct calls for destruction)
:optref refid='SWxst'.
.do end
.*
.if &e'&$SWxss eq 1 .do begin
.note xss
enable exception handling (table-driven destructors)
:optref refid='SWxss'.
.do end
.*
.*
.endnote
.*
.section Double-Byte/Unicode Characters
.*
.begnote $compact $setptnt 10
.ix 'options' 'double-byte characters'
.notehd1 Option:
.notehd2 Description:
.if &e'&$SWzk eq 1 .do begin
.note zk{0,1,2,l}
double-byte char support: 0=Kanji,1=Chinese/Taiwanese,2=Korean,l=local
:optref refid='SWzk'.
.do end
.if &e'&$SWzk0u eq 1 .do begin
.note zk0u
translate double-byte Kanji to UNICODE
:optref refid='SWzk0u'.
.do end
.if &e'&$SWzku eq 1 .do begin
.note zku=<codepage>
load UNICODE translate table for specified code page
:optref refid='SWzku'.
.do end
.endnote
.*
.if &e'&$SWvc eq 1 .do begin
.*
.section Compatibility with Microsoft Visual C++
.*
.begnote $compact $setptnt 10
.ix 'options' 'compatibility with Visual C++'
.notehd1 Option:
.notehd2 Description:
.note vc...
VC++ compatibility options
:optref refid='SWvc'.
.note vcap
allow alloca() or _alloca() in a parameter list
.endnote
.do end
.*
.section Compatibility with Older Versions of the 80x86 Compilers
.*
.begnote $compact $setptnt 10
.ix 'options' 'compatibility with older versions'
.notehd1 Option:
.notehd2 Description:
.if &e'&$SWr eq 1 .do begin
.note r
save/restore segment registers across calls
:optref refid='SWr'.
.do end
.if &e'&$SWfpr eq 1 .do begin
.note fpr
generate backward compatible 80x87 code
:optref refid='SWfpr'.
.do end
.if &e'&$SWzz eq 1 .do begin
.note zz
generate backward compatible __stdcall conventions by removing the
"@size" from __stdcall function names (10.0 compatible)
:optref refid='SWzz'.
.do end
.endnote
.*
.helppref
.*
.endlevel
.*
.section Compiler Options - Full Description
.*
.np
.ix 'compiling options'
In the following sections, we present complete descriptions of
compiler options organized into categories.
.*
.beglevel
.*
.section Target Specific
.*
.np
This group of options deals with characteristics of the target
application;
for example, simple executables versus Dynamic Link Libraries,
character-mode versus graphical user interface,
single-threaded versus multi-threaded,
and so on.
.*
:OPTLIST.
.*
.if &e'&$SWbc eq 1 .do begin
:OPT refid='SWbc' name='bc'.
.ix 'options' 'bc'
.ix 'console application'
(OS/2, Win16/32 only)
This option causes the compiler to emit into the object file
references to the appropriate startup code for a character-mode
console application.
The presence of
.id LibMain/DLLMain
or
.id WinMain/wWinMain
in the source code does not influence the selection of startup code.
Only
.id main
and
.id wmain
are significant.
.np
If none of "bc", "bd", "bg" or "bw" are specified then the order of
priority in determining which combination of startup code and
libraries to use are as follows.
.autonote
.note
The presence of one of
.id LibMain
or
.id DLLMain
implies that the DLL startup code and libraries should be used.
.note
The presence of
.id WinMain
or
.id wWinMain
implies that the GUI startup code and libraries should be used.
.note
The presence of
.id main
or
.id wmain
implies that the default startup code and libraries should be used.
.endnote
.np
If both a wide and non-wide version of an entry point are specified,
the "wide" entry point will be used.
Thus
.id wWinMain
is called when both
.id WinMain
and
.id wWinMain
are present.
Similarly,
.id wmain
is called when both
.id main
and
.id wmain
are present (and
.id WinMain/wWinMain
are not present).
By default, if both
.id wmain
and
.id WinMain
are included in the source code, then the startup code will attempt
to call
.id wWinMain
(since both "wide" and "windowed" entry points were included).
.if '&target' eq 'QNX' .do begin
This option does not apply to QNX.
.do end
.do end
.*
.if &e'&$SWbd eq 1 .do begin
:OPT refid='SWbd' name='bd'.
.ix 'options' 'bd'
.ix 'dynamic link library'
.ix 'DLL'
.ix '__DLLstart_'
(OS/2, Win16/32 only)
This option causes the compiler to emit into the object file
references to the run-time DLL startup code (reference to the
.id __DLLstart_
symbol) and, if required, special
versions of the run-time libraries that support DLLs. The presence of
.id main/wmain
or
.id WinMain/wWinMain
in the source code does not influence the selection of startup code.
Only
.id LibMain
and
.id DLLMain
are significant
:optref refid='SWbc'..
If you are building a DLL with statically linked C runtime (the default),
it is recommended that you compile at least one of its object files with
the "bd" switch to ensure that the DLL's C runtime is properly initialized.
.ix 'predefined macros' 'see macros'
.ix 'macros' '__SW_BD'
The macro
.kwm __SW_BD
will be predefined if "bd" is selected.
.if '&target' eq 'QNX' .do begin
This option does not apply to QNX.
.do end
.do end
.*
.if &e'&$SWbg eq 1 .do begin
:OPT refid='SWbg' name='bg'.
.ix 'options' 'bg'
.ix 'console application'
(OS/2, Win16/32 only)
This option causes the compiler to emit into the object file
references to the appropriate startup code for a windowed (GUI)
application.
The presence of
.id LibMain/DLLMain
or
.id main/wmain
in the source code does not influence the selection of startup code.
Only
.id WinMain
and
.id wWinMain
are significant
:optref refid='SWbc'..
.if '&target' eq 'QNX' .do begin
This option does not apply to QNX.
.do end
.do end
.*
.if &e'&$SWbm eq 1 .do begin
:OPT refid='SWbm' name='bm'.
.ix 'options' 'bm'
(Netware, OS/2, Win32 only)
This option causes the compiler to emit into the object file
references to the appropriate multi-threaded library name(s).
.ix 'macros' '_MT'
.ix 'macros' '__SW_BM'
The macros
.kwm _MT
and
.kwm __SW_BM
will be predefined if "bm" is selected.
.if '&target' eq 'QNX' .do begin
This option does not apply to QNX.
.do end
.do end
.*
.if &e'&$SWbr eq 1 .do begin
:OPT refid='SWbr' name='br'.
.ix 'options' 'br'
(OS/2, Win32 only)
This option causes the compiler to emit into the object file
references to the run-time DLL library name(s).
The run-time DLL libraries are special subsets of the &product
run-time libraries that are available as DLLs.
When you use this option with an OS/2 application, you must also
specify the "CASEEXACT" option to the &lnkname..
.ix 'macros' '_DLL'
.ix 'macros' '__SW_BR'
The macros
.kwm _DLL
and
.kwm __SW_BR
will be predefined if "br" is selected.
.if '&target' eq 'QNX' .do begin
This option does not apply to QNX.
.do end
.do end
.*
.if &e'&$SWbt eq 1 .do begin
:OPT refid='SWbt' name='bt'.[=<os>]
.ix 'options' 'bt'
This option causes the compiler to define the "build" target.
This option is used for cross-development work.
It prevents the compiler from defining the default build target (which
is based on the host system the compiler is running on).
The default build targets are:
.begnote
.note DOS
when the host operating system is DOS,
.note OS2
when the host operating system is OS/2,
.note NT
when the host operating system is Windows NT (including Windows 95),
.note QNX
when the host operating system is QNX.
or
.note LINUX
when the host operating system is Linux.
.endnote
.np
It also prevents the compiler from defining the default target macro.
Instead the compiler defines a macro consisting of the string "<os>"
converted to uppercase and prefixed and suffixed with two underscores.
The default target macros are described in the
section entitled :HDREF refid='wccmacs'..
.np
For example, specifying the option:
.millust begin
bt=foo
.millust end
.pc
would cause the compiler to define the macro
.millust begin
__FOO__
.millust end
.pc
and prevent it from defining
.kwm MSDOS
.ct ,
.kwm _DOS
and
.kwm __DOS__
if the compiler was being run under DOS,
.kwm __OS2__
if using the OS/2 hosted compiler,
.kwm __NT__
if using the Windows NT or Windows 95 hosted compiler,
.kwm __QNX__
.kwm __UNIX__
if using the QNX hosted version.
or
.kwm __LINUX__
.kwm __UNIX__
if using the Linux hosted version.
Any string consisting of letters, digits, and the underscore character
may be used for the target name.
.np
The compiler will also construct an environment variable called
.ev <os>_INCLUDE
and see if it has been defined.
If the environment variable is defined then each directory listed in
it is searched (in the order that they were specified).
For example, the environment variable
.ev WINDOWS_INCLUDE
will be searched if
.sy bt=WINDOWS
option was specified.
.exam begin 1
&setcmd. windows_include=&pc.watcom&pc.h&pc.win
.exam end
.np
Include file processing is described in the
section entitled :HDREF refid='wccinc'..
.np
Several target names are recognized by the compiler and perform
additional operations.
.begnote $setptnt 10
.notehd1 Target name
.notehd2 Additional operation
.note DOS
Defines the macros
.kwm _DOS
and
.kwm MSDOS.
.note WINDOWS
Same as specifying one of the "zw" options.
Defines the macros
.kwm _WINDOWS
(16-bit only)
and
.kwm __WINDOWS_386__
(32-bit only).
.note NETWARE
(32-bit only)
Causes the compiler to use stack-based calling conventions.
Also defines the macro
.kwm __NETWARE_386__.
.note QNX
Defines the macro
.kwm __UNIX__.
.note LINUX
Defines the macro
.kwm __UNIX__.
.endnote
.np
Specifying "bt" with no target name following restores the default
target name.
.do end
.*
.if &e'&$SWbw eq 1 .do begin
:OPT refid='SWbw' name='bw'.
.ix 'options' 'bw'
(Win16 only)
This option causes the compiler to import a special symbol so that the
default windowing library code is linked into your application.
The presence of
.id LibMain/DLLMain
in the source code does not influence the selection of startup code.
Only
.id main,
.id wmain,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -