Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
da6eff29
Commit
da6eff29
authored
Jan 28, 2005
by
simonmar
Browse files
[project @ 2005-01-28 14:41:09 by simonmar]
Document {-# INCLUDE #-}
parent
b4b792b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/docs/users_guide/glasgow_exts.xml
View file @
da6eff29
...
...
@@ -4200,6 +4200,31 @@ Assertion failures can be caught, see the documentation for the
<option>
-fno-warn-deprecations
</option>
.
</para>
</sect2>
<sect2
id=
"include-pragma"
>
<title>
INCLUDE pragma
</title>
<para>
The
<literal>
INCLUDE
</literal>
pragma is for specifying the names
of C header files that should be
<literal>
#include
</literal>
'd into
the C source code generated by the compiler for the current module (if
compiling via C). For example:
</para>
<programlisting>
{-# INCLUDE "foo.h" #-}
{-# INCLUDE
<
stdio.h
>
#-}
</programlisting>
<para>
The
<literal>
INCLUDE
</literal>
pragma(s) must appear at the top of
your source file with any
<literal>
OPTIONS_GHC
</literal>
pragma(s).
</para>
<para>
An
<literal>
INCLUDE
</literal>
pragma is the preferred alternative
to the
<option>
-#include
</option>
option (
<xref
linkend=
"options-C-compiler"
/>
), because the
<literal>
INCLUDE
</literal>
pragma is understood by other
compilers. Yet another alternative is to add the include file to each
<literal>
foreign import
</literal>
declaration in your code, but we
don't recommend using this approach with GHC.
</para>
</sect2>
<sect2
id=
"inline-noinline-pragma"
>
<title>
INLINE and NOINLINE pragmas
</title>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment