Sign in Join
Wiki copytemporary

modeswitches: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11Mode switches enable specific functionality and are enabled using the compiler directive {\$modeswitch name}.
22
33Free pascal supports the following mode switches.
44
5-` m_class,               { delphi class model }`\
6-` m_objpas,              { load objpas unit }`\
7-` m_result,              { result in functions }`\
8-` m_string_pchar,        { pchar 2 string conversion }`\
9-` m_cvar_support,        { cvar variable directive }`\
10-` m_nested_comment,      { nested comments }`\
11-` m_tp_procvar,          { tp style procvars (no @ needed) }`\
12-` m_mac_procvar,         { macpas style procvars }`\
13-` m_repeat_forward,      { repeating forward declarations is needed }`\
14-` m_pointer_2_procedure, { allows the assignement of pointers to`\
15-`                          procedure variables                     }`\
16-` m_autoderef,           { does auto dereferencing of struct. vars }`\
17-` m_initfinal,           { initialization/finalization for units }`\
18-` m_default_ansistring,  { ansistring turned on by default }`\
19-` m_out,                 { support the calling convention OUT }`\
20-` m_default_para,        { support default parameters }`\
21-` m_hintdirective,       { support hint directives }`\
22-` m_duplicate_names,     { allow locals/paras to have duplicate names of globals }`\
23-` m_property,            { allow properties }`\
24-` m_default_inline,      { allow inline proc directive }`\
25-` m_except,              { allow exception-related keywords }`\
26-` m_objectivec1,         { support interfacing with Objective-C (1.0) }`\
27-` m_objectivec2,         { support interfacing with Objective-C (2.0) }`\
28-` m_nested_procvars,     { support nested procedural variables }`\
29-` m_non_local_goto,      { support non local gotos (like iso pascal) }`\
30-` m_advanced_records,    { advanced record syntax with visibility sections, methods and properties }`\
31-` m_isolike_unary_minus, { unary minus like in iso pascal: same precedence level as binary minus/plus }`\
32-` m_systemcodepage,      { use system codepage as compiler codepage by default, emit ansistrings with system codepage }`\
33-` m_final_fields,        { allows declaring fields as "final", which means they must be initialised`\
34-`                          in the (class) constructor and are constant from then on (same as final`\
35-`                          fields in Java) }`\
36-` m_default_unicodestring, { makes the default string type in $h+ mode unicodestring rather than`\
37-`                            ansistring; similarly, char becomes unicodechar rather than ansichar }`\
38-` m_type_helpers,        { allows the declaration of "type helper" for all supported types`\
39-`                          (primitive types, records, classes, interfaces) }`\
40-` m_blocks,              { support for `[`http://en.wikipedia.org/wiki/Blocks_(C_language_extension)`](http://en.wikipedia.org/wiki/Blocks_(C_language_extension))` }`\
41-` m_isolike_io,          { I/O as it required by an ISO compatible compiler }`\
42-` m_isolike_program_para, { program parameters as it required by an ISO compatible compiler }`\
43-` m_isolike_mod,         { mod operation as it is required by an iso compatible compiler }`\
44-` m_array_operators,     { use Delphi compatible array operators instead of custom ones ("+") }`\
45-` m_multi_helpers        { helpers can appear in multiple scopes simultaneously }`
5+``` pascal
6+ m_class, { delphi class model }
7+ m_objpas, { load objpas unit }
8+ m_result, { result in functions }
9+ m_string_pchar, { pchar 2 string conversion }
10+ m_cvar_support, { cvar variable directive }
11+ m_nested_comment, { nested comments }
12+ m_tp_procvar, { tp style procvars (no @ needed) }
13+ m_mac_procvar, { macpas style procvars }
14+ m_repeat_forward, { repeating forward declarations is needed }
15+ m_pointer_2_procedure, { allows the assignement of pointers to
16+ procedure variables }
17+ m_autoderef, { does auto dereferencing of struct. vars }
18+ m_initfinal, { initialization/finalization for units }
19+ m_default_ansistring, { ansistring turned on by default }
20+ m_out, { support the calling convention OUT }
21+ m_default_para, { support default parameters }
22+ m_hintdirective, { support hint directives }
23+ m_duplicate_names, { allow locals/paras to have duplicate names of globals }
24+ m_property, { allow properties }
25+ m_default_inline, { allow inline proc directive }
26+ m_except, { allow exception-related keywords }
27+ m_objectivec1, { support interfacing with Objective-C (1.0) }
28+ m_objectivec2, { support interfacing with Objective-C (2.0) }
29+ m_nested_procvars, { support nested procedural variables }
30+ m_non_local_goto, { support non local gotos (like iso pascal) }
31+ m_advanced_records, { advanced record syntax with visibility sections, methods and properties }
32+ m_isolike_unary_minus, { unary minus like in iso pascal: same precedence level as binary minus/plus }
33+ m_systemcodepage, { use system codepage as compiler codepage by default, emit ansistrings with system codepage }
34+ m_final_fields, { allows declaring fields as "final", which means they must be initialised
35+ in the (class) constructor and are constant from then on (same as final
36+ fields in Java) }
37+ m_default_unicodestring, { makes the default string type in $h+ mode unicodestring rather than
38+ ansistring; similarly, char becomes unicodechar rather than ansichar }
39+ m_type_helpers, { allows the declaration of "type helper" for all supported types
40+ (primitive types, records, classes, interfaces) }
41+ m_blocks, { support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension) }
42+ m_isolike_io, { I/O as it required by an ISO compatible compiler }
43+ m_isolike_program_para, { program parameters as it required by an ISO compatible compiler }
44+ m_isolike_mod, { mod operation as it is required by an iso compatible compiler }
45+ m_array_operators, { use Delphi compatible array operators instead of custom ones ("+") }
46+ m_multi_helpers { helpers can appear in multiple scopes simultaneously }
47+```
4648
4749## See also
4850
4951- [[Compiler Mode]]
5052- [[modeswitch]]
5153
5254---
5355*From the Free Pascal wiki, page "modeswitches", as it stood on 2024-05-03 after a change by Hieroly, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
5456Category: FPC
5557Category: Modes

Back to history