]> granicus.if.org Git - graphviz/commitdiff
more commentary - add note that trailing "," is only a problem when the
authorellson <devnull@localhost>
Thu, 10 Nov 2005 14:39:01 +0000 (14:39 +0000)
committerellson <devnull@localhost>
Thu, 10 Nov 2005 14:39:01 +0000 (14:39 +0000)
header is used from a .cpp file and the compiler thinks it is C++

lib/gvc/gvplugin.h

index 9d4bc42ccfec259585462f9f73614e38a2286f31..880b693be85fd0d3744938a135cffefa16b9b50d 100644 (file)
@@ -44,16 +44,21 @@ extern "C" {
  */
 #define APIS ELEM(render) ELEM(layout) ELEM(textlayout) ELEM(device) ELEM(usershape)
 
+/*
+ * Define api_t using names based on the plugin names with API_ prefixed.
+ */
 #define ELEM(x) API_##x,
-    typedef enum { APIS DUMMY_ELEM=0 } api_t; /* API_render, API_layout, ... */
-                       /* Stupid but true:... The sole purpose of "DUMMY_ELEM=0"
+    typedef enum { APIS _DUMMY_ELEM_=0 } api_t; /* API_render, API_layout, ... */
+                       /* Stupid but true: The sole purpose of "_DUMMY_ELEM_=0"
                         * is to avoid a "," after the last element of the enum
-                        * because some compilers when using "-pedantic" complain
-                        * about the dangling "," !  Setting it to 0 makes sure
-                        * that the enumeration does not define an extra value.
-                        * (It does however define DUMMY_ELEM as an enumeration
-                        * symbol, but its value duplicates that of the first
-                        * symbol in the enumeration - in this case "render". )
+                        * because some compilers when using "-pedantic"
+                        * generate an error for about the dangling ","
+                        * but only if this header is used from a .cpp file!
+                        * Setting it to 0 makes sure that the enumeration
+                        * does not define an extra value.  (It does however
+                        * define _DUMMY_ELEM_ as an enumeration symbol,
+                        * but its value duplicates that of the first
+                        * symbol in the enumeration - in this case "render".)
                         */
 
                        /* One could wonder why trailing "," in: