JCL Conditional Defines

From Project JEDI Wiki
Jump to navigationJump to search

Enable thread-safe code

When checked, thread-safe code is enabled for some code of the JCL. This includes notifiers in JclNotify.pas, memory-mapped files in JclSysUtils.pas and all the containers.

Drop obsolete code

This options control whether obsolete code is compiled or not. Some definitions might be deprecated during the development of the library. Most of them are kept for a while and users can continue using them by unchecking this option.

Include Unit Versioning

When this option is checked, each JCL unit registers its version information and these informations can be queried, see JclUnitVersioning.pas for more details.

Math options

Two math options can be customized for JclMath.pas and JclBase.pas.

Float Precision

The type Float is defined in JclBase.pas as an alias for compiler built-in types. This alias type can be configured to be equal either to Single, Double or Extended. This third choice is available only for the 32-bit targets.

This alias is used in various places in the JCL: including and not limited to complex numbers, expression evaluator, XML parser... The modification of this installation setting will have side effects in all the pieces of code that make reference to Float.

Supports for infinite and NaN

Various routines in JclMath.pas have special behaviors when their operands are floating point special values such as infinite or NaN. These additional checks slightly slow down computations and disabling the support for these corner cases can help in some situation.

Container options

Alias for string containers

The containers units define container classes for builtin compiler types AnsiString, WideString and UnicodeString (only for targets that support this type).

This setting configure how the containers for "string" are defined: they can be alias to either the AnsiString containers, or to the WideString containers or to the UnicodeString when this type is available. An other option is available to avoid the creation of these container alias classes.

Debug and exception hooking options

Several options can configure JclDebug.pas and JclHookExcept.pas.

Hook exceptions in DLL

When enabled, the exception tracking system of the JCL can trace exceptions raised in DLL compiled with support for the exception tracking system.

Debug sources

For displaying the stack trace, JclDebug.pas can use several source of informations: embedded or standalone JDBG, Map file, TD32 debug information, export symbols, PDB or DBG debug files. Each one can be explicitly disabled by setting its corresponding setting.

PCRE options

The code in JclPCRE.pas and pcre.pas relies on the external open-source library PCRE that is written in C.

These options control how this library is linked to the JCL:

  • the JCL can statically import the pcre DLL: pcre.dll must be distributed along with your application;
  • the JCL can dynamically import the pcre DLL: pcre.dll will be loaded "on-demand";
  • the JCL can embed the pcre code: everything will be inside your application.

BZip2 options

The code in JclCompression.pas and bzip2.pas relies on the external open-source library BZip that is written in C.

The linking to this library can be configured in the same way as for PCRE.

ZLib options

The code in JclCompression.pas and zlibh.pas relies on the external open-source library zlib that is written in C.

The linking to this library can be configured in the same way as for PCRE.

Unicode options

The file JclUnicode.pas can be configured by various options.

Silent failure

When an unknown character is met, the special Unicode replacement character can be inserted silently. Otherwise, the JCL code can raise an exception.

Compression

The Unicode Character Database (UCD - taken from http://unicode.org/ucd/ adds about 500kB to your application. This size can be reduced by compressing this resource using zlib or bzip2 methods.

Sevenzip options

The code in JclCompression.pas and sevenzip.pas relies on the external open-source library sevenzip that is written in C++.

The linking to this library can be configured in two ways:

  • the JCL can statically import 7z.dll: it must be distributed along with your application;
  • the JCL can dynamically import 7z.dll: it will be loaded "on-demand";