@@ -217,8 +217,21 @@ global variable with the following name. The type must be just ``IO Ptr``.
217217 errno : IO Ptr
218218 errno = foreign FFI_C "&errno" (IO Ptr)
219219
220−For more complicated interactions with C (such as reading and setting fields of a C struct), there is
221−a module CFFI available in the contrib package.
220+If the foreign name is prefixed by a ``#``, the name is pasted in literally. This is
221+useful to access constants that are preprocessor definitions (like ``INT_MAX``).
222+
223+..code-block:: idris
224+ %include C "limits.h"
225+
226+ -- access the preprocessor definition INT_MAX
227+ intMax : IO Int
228+ intMax = foreign FFI_C "#INT_MAX" (IO Int)
229+
230+ main : IO ()
231+ main = print !intMax
232+
233+For more complicated interactions with C (such as reading and setting fields
234+of a C struct), there is a module CFFI available in the contrib package.
222235
223236FFI implementation
224237------------------