From 8c8646773024ea740c4c9f090619ddaf61bc16f0 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 30 Sep 2015 12:29:32 -0700 Subject: document new bitsize pragma --- doc/manual/pragmas.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/manual') diff --git a/doc/manual/pragmas.txt b/doc/manual/pragmas.txt index 68a88f865..f89194c9a 100644 --- a/doc/manual/pragmas.txt +++ b/doc/manual/pragmas.txt @@ -531,6 +531,24 @@ Implementation Specific Pragmas This section describes additional pragmas that the current Nim implementation supports but which should not be seen as part of the language specification. +Bitsize pragma +-------------- + +The ``bitsize`` pragma is for object field members. It declares the field as +a bitfield in C/C++. + +.. code-block:: Nim + type + mybitfield = object + flag {.bitsize:1.}: cuint + +generates: + +.. code-block:: C + struct mybitfield { + unsigned int flag:1; + }; + Volatile pragma --------------- -- cgit 1.4.1-2-gfad0