summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2013-02-12 18:21:24 +0100
committerArmin Rigo <arigo@tunes.org>2013-02-12 18:21:24 +0100
commitddbaf3b0def21815bca2dfce023e159ea73c36dd (patch)
tree97698209d48608de143a9edb6953f73d5feb3a1c
parentcf7b3a4cbdb8a131ef08a09f02234532fb08f7e0 (diff)
downloadcffi-enum-as-int.tar.gz
More documentationenum-as-int
-rw-r--r--doc/source/index.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 9834f1d..526cd01 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1347,9 +1347,10 @@ a pointer inside the Python string object.
functions like ``long double add(long double a, long double b);``.
.. versionchanged:: 0.6
- `(*****)` Enums are now handled like ints. In previous versions,
- you would get the enum's value as a string. Now we follow the C
- convention and treat them as really equivalent to ints. To compare
+ `(*****)` Enums are now handled like ints (unsigned or signed, int or
+ long, like GCC; note that the first choice is unsigned). In previous
+ versions, you would get the enum's value as a string. Now we follow the C
+ convention and treat them as really equivalent to integers. To compare
their value symbolically, use code like ``if x.field == lib.FOO``.
If you really want to get their value as a string, use
``ffi.string(ffi.cast("the_enum_type", x.field))``.