[pypy-commit] cffi default: Document the alternative enum syntax.

arigo noreply at buildbot.pypy.org
Sat Aug 25 15:41:08 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r896:09a69511887e
Date: 2012-08-25 15:40 +0200
http://bitbucket.org/cffi/cffi/changeset/09a69511887e/

Log:	Document the alternative enum syntax.

diff --git a/doc/source/index.rst b/doc/source/index.rst
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -475,8 +475,10 @@
 *  enums: if you don't know the exact order (or values) of the declared
    constants, then use this syntax: "``enum foo { A, B, C, ... };``"
    (with a trailing "``...``").  The C compiler will be used to figure
-   out the exact values of the constants.  Like
-   with structs, an ``enum`` that does not end in "``...``" is assumed to
+   out the exact values of the constants.  An alternative syntax is
+   "``enum foo { A=..., B, C };``" or even
+   "``enum foo { A=..., B=..., C=... };``".  Like
+   with structs, an ``enum`` without "``...``" is assumed to
    be exact, and this is checked.
 
 *  integer macros: you can write in the ``cdef`` the line


More information about the pypy-commit mailing list