diff options
author | Aman Gupta <aman@tmm1.net> | 2015-09-30 12:29:32 -0700 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2015-09-30 12:29:32 -0700 |
commit | 8c8646773024ea740c4c9f090619ddaf61bc16f0 (patch) | |
tree | e6f79be0348c77bc38e7bdebc09ac934b0629fd8 /doc/manual | |
parent | 87ab263d5218911335d83fddafddc090348290bd (diff) | |
download | Nim-8c8646773024ea740c4c9f090619ddaf61bc16f0.tar.gz |
document new bitsize pragma
Diffstat (limited to 'doc/manual')
-rw-r--r-- | doc/manual/pragmas.txt | 18 |
1 files changed, 18 insertions, 0 deletions
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 --------------- |