Commit 637535d7 by Arnaud Charlet

gnat_rm.texi, [...]: Update documentation.

        * gnat_rm.texi, gnat_ugn.texi,
        doc/gnat_ugn/platform_specific_information.rst,
        doc/gnat_ugn/gnat_and_program_execution.rst,
        doc/gnat_ugn/the_gnat_compilation_model.rst,
        doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
        doc/gnat_rm/implementation_defined_pragmas.rst: Update documentation.

From-SVN: r230232
parent 53044824
......@@ -4456,7 +4456,7 @@ the effect is identical to the following Ada 2012 code:
Dynamic_Predicate => F(Q) or G(Q);
Note that there is are no pragmas `Dynamic_Predicate`
Note that there are no pragmas `Dynamic_Predicate`
or `Static_Predicate`. That is
because these pragmas would affect legality and semantics of
the program and thus do not have a neutral effect if ignored.
......@@ -4471,6 +4471,23 @@ fundamentally changed (for example a membership test
defined for subtype B). When following this approach, the
use of predicates should be avoided.
Pragma Predicate_Failure
========================
Syntax:
::
pragma Predicate_Failure
([Entity =>] type_LOCAL_NAME,
[Message =>] String_Expression);
The `Predicate_Failure` pragma is intended to be an exact replacement for
the language-defined
`Predicate_Failure` aspect, and shares its restrictions and semantics.
Pragma Preelaborable_Initialization
===================================
......
......@@ -857,6 +857,21 @@ Note that this the implementation of this restriction requires full
code generation. If it is used in conjunction with "semantics only"
checking, then some cases of violations may be missed.
No_Dynamic_Sized_Objects
--------------
.. index:: No_Dynamic_Sized_Objects
[GNAT] This restriction disallows certain constructs that might lead to the
creation of dynamic-sized composite objects (or array or discriminated type).
An array subtype indication is illegal if the bounds are not static
or references to discriminants of an enclosing type.
A discriminated subtype indication is illegal if the type has
discriminant-dependent array components or a variant part, and the
discriminants are not static. In addition, array and record aggregates are
illegal in corresponding cases. Note that this restriction does not forbid
access discriminants. It is often a good idea to combine this restriction
with No_Secondary_Stack.
No_Entry_Queue
--------------
.. index:: No_Entry_Queue
......@@ -1097,4 +1112,3 @@ currently checked by the SPARK_05 restriction:
Note that if a unit is compiled in Ada 95 mode with the SPARK restriction,
violations will be reported for constructs forbidden in SPARK 95,
instead of SPARK 2005.
......@@ -3884,7 +3884,7 @@ execution of this erroneous program:
it to obtain accurate dynamic memory usage history at a minimal cost to the
execution speed. Note however, that `gnatmem` is not supported on all
platforms (currently, it is supported on AIX, HP-UX, GNU/Linux, Solaris and
Windows NT/2000/XP (x86).
Windows.
The `gnatmem` command has the form
......
......@@ -943,24 +943,19 @@ There can actually be other sections in a definition file, but these
sections are not relevant to the discussion at hand.
.. rubric:: GNAT-Style Import Library
.. _GNAT-Style_Import_Library:
.. _Create_Def_File_Automatically:
To create a static import library from :file:`API.dll` with the GNAT tools
you should proceed as follows:
.. rubric:: Creating a Definition File Automatically
* Create the definition file :file:`API.def`
(see :ref:`The Definition File <The_Definition_File>`).
For that use the `dll2def` tool as follows:
You can automatically create the definition file :file:`API.def`
(see :ref:`The Definition File <The_Definition_File>`) from a DLL.
For that use the `dlltool` program as follows:
::
$ dll2def API.dll > API.def
$ dlltool API.dll -z API.def --export-all-symbols
`dll2def` is a very simple tool: it takes as input a DLL and prints
to standard output the list of entry points in the DLL. Note that if
some routines in the DLL have the `Stdcall` convention
Note that if some routines in the DLL have the `Stdcall` convention
(:ref:`Windows_Calling_Conventions`) with stripped :samp:`@{nn}`
suffix then you'll have to edit :file:`api.def` to add it, and specify
*-k* to *gnatdll* when creating the import library.
......@@ -979,8 +974,14 @@ you should proceed as follows:
tells you what symbol is expected. You just have to go back to the
definition file and add the right suffix.
* Build the import library `libAPI.dll.a`, using `gnatdll`
(see :ref:`Using_gnatdll`) as follows:
.. _GNAT-Style_Import_Library:
.. rubric:: GNAT-Style Import Library
To create a static import library from :file:`API.dll` with the GNAT tools
you should create the .def file, then use `gnatdll` tool
(see :ref:`Using_gnatdll`) as follows:
::
......@@ -997,21 +998,17 @@ you should proceed as follows:
DLL (:ref:`Using_gnatdll` for more information about `gnatdll`).
.. _MSVS-Style_Import_Library:
.. rubric:: Microsoft-Style Import Library
With GNAT you can either use a GNAT-style or Microsoft-style import
library. A Microsoft import library is needed only if you plan to make an
A Microsoft import library is needed only if you plan to make an
Ada DLL available to applications developed with Microsoft
tools (:ref:`Mixed-Language_Programming_on_Windows`).
To create a Microsoft-style import library for :file:`API.dll` you
should proceed as follows:
* Create the definition file :file:`API.def` from the DLL. For this use either
the `dll2def` tool as described above or the Microsoft `dumpbin`
tool (see the corresponding Microsoft documentation for further details).
* Build the actual import library using Microsoft's `lib` utility:
should create the .def file, then build the actual import library using
Microsoft's `lib` utility:
::
......@@ -1847,6 +1844,58 @@ option:
$ gnatmake myprog -largs myres.o
.. _Using_GNAT_DLL_from_MSVS:
Using GNAT DLLs from Microsoft Visual Studio Applications
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. index:: Microsoft Visual Studio, use with GNAT DLLs
This section describes a common case of mixed GNAT/Microsoft Visual Studio
application development, where the main program is developed using MSVS, and
is linked with a DLL developed using GNAT. Such a mixed application should
be developed following the general guidelines outlined above; below is the
cookbook-style sequence of steps to follow:
1. First develop and build the GNAT shared library using a library project
(let's assume the project is `mylib.gpr`, producing the library `libmylib.dll`):
::
$ gprbuild -p mylib.gpr
2. Produce a .def file for the symbols you need to interface with, either by
hand or automatically with possibly some manual adjustments
(see :ref:`Creating Definition File Automatically <Create_Def_File_Automatically>`):
::
$ dlltool libmylib.dll -z libmylib.def --export-all-symbols
3. Make sure that MSVS command-line tools are accessible on the path.
4. Create the Microsoft-style import library (see :ref:`MSVS-Style Import Library <MSVS-Style_Import_Library>`):
::
$ lib -machine:IX86 -def:libmylib.def -out:libmylib.lib
If you are using a 64-bit toolchain, the above becomes...
::
$ lib -machine:X64 -def:libmylib.def -out:libmylib.lib
5. Build the C main
::
$ cl /O2 /MD main.c libmylib.lib
6. Before running the executable, make sure you have set the PATH to the DLL,
or copy the DLL into into the directory containing the .exe.
.. _Debugging_a_DLL:
Debugging a DLL
......@@ -2119,6 +2168,66 @@ Under Windows systems, it is possible to specify the program heap size from
because the coma is a separator for this option.
.. _Win32_Specific_Addons:
Windows Specific Add-Ons
-------------------------
This section describes the Windows specific add-ons.
.. _Win32Ada:
Win32Ada
^^^^^^^^
Win32Ada is a binding for the Microsoft Win32 API. This binding can be
easily installed from the provided installer. To use the Win32Ada
binding you need to use a project file, and adding a single with_clause
will give you full access to the Win32Ada binding sources and ensure
that the proper libraries are passed to the linker.
.. code-block:: ada-project
with "win32ada";
project P is
for Sources use ...;
end P;
To build the application you just need to call gprbuild for the
application's project, here p.gpr:
.. code-block:: sh
gprbuild p.gpr
.. _wPOSIX:
wPOSIX
^^^^^^
wPOSIX is a minimal POSIX binding whose goal is to help with building
cross-platforms applications. This binding is not complete though, as
the Win32 API does not provide the necessary support for all POSIX APIs.
To use the wPOSIX binding you need to use a project file, and adding
a single with_clause will give you full access to the wPOSIX binding
sources and ensure that the proper libraries are passed to the linker.
.. code-block:: ada-project
with "wposix";
project P is
for Sources use ...;
end P;
To build the application you just need to call gprbuild for the
application's project, here p.gpr:
.. code-block:: sh
gprbuild p.gpr
.. _Mac_OS_Topics:
Mac OS Topics
......@@ -2185,5 +2294,3 @@ where "gdb-cert" should be replaced by the actual certificate
name chosen above, and <gnat_install_prefix> should be replaced by
the location where you installed GNAT. Also, be sure that users are
in the Unix group ``_developer``.
......@@ -3665,7 +3665,7 @@ Convention identifiers are recognized by GNAT:
.. index:: Convention Stdcall
*Stdcall*
This is relevant only to Windows XP/2000/NT implementations of GNAT,
This is relevant only to Windows implementations of GNAT,
and specifies that the `Stdcall` calling sequence will be used,
as defined by the NT API. Nevertheless, to ease building
cross-platform bindings this convention will be handled as a `C` calling
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment