Sign in Join
Wiki copytemporary

modeswitches: what changed

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

Title: modeswitches

OldNewLine
1+Mode switches enable specific functionality and are enabled using the compiler directive {\$modeswitch name}.
2+
3+Free pascal supports the following mode switches.
4+
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 }`
46+
47+## See also
48+
49+- [[Compiler Mode]]
50+- [[modeswitch]]
51+
52+---
53+*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).*
54+Category: FPC
55+Category: Modes

Back to history