summary refs log tree commit diff stats
path: root/doc/manual
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2015-09-30 12:29:32 -0700
committerAman Gupta <aman@tmm1.net>2015-09-30 12:29:32 -0700
commit8c8646773024ea740c4c9f090619ddaf61bc16f0 (patch)
treee6f79be0348c77bc38e7bdebc09ac934b0629fd8 /doc/manual
parent87ab263d5218911335d83fddafddc090348290bd (diff)
downloadNim-8c8646773024ea740c4c9f090619ddaf61bc16f0.tar.gz
document new bitsize pragma
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/pragmas.txt18
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
 ---------------