Pretty simple. Both flag-types.h and tree-core.h check to see if the other header has already defined this enumerated type, and defined it if not.

Its an unnecessary conditional compilation and dual maintenance of this small enum. This patch puts it in coretypes.h and makes it always available.

Bootstraps on x86_64-pc-linux-gnu with no new regressions.  Ok for trunk?

Andrew
	* coretypes.h (enum symbol_visibility): Relocate here.
	* flag-types.h (enum symbol_visibility): Remove.
	* tree-core.h (enum symbol_visibility): Remove.

Index: coretypes.h
===================================================================
*** coretypes.h	(revision 224292)
--- coretypes.h	(working copy)
*************** enum function_class {
*** 263,268 ****
--- 263,278 ----
    function_c11_misc
  };
  
+ /* Enumerate visibility settings.  This is deliberately ordered from most
+    to least visibility.  */
+ enum symbol_visibility
+ {
+   VISIBILITY_DEFAULT,
+   VISIBILITY_PROTECTED,
+   VISIBILITY_HIDDEN,
+   VISIBILITY_INTERNAL
+ };
+ 
  /* Suppose that higher bits are target dependent. */
  #define MEMMODEL_MASK ((1<<16)-1)
  
Index: flag-types.h
===================================================================
*** flag-types.h	(revision 224292)
--- flag-types.h	(working copy)
*************** enum debug_struct_file
*** 91,109 ****
    DINFO_STRUCT_FILE_ANY     /* Debug structs defined in all files. */
  };
  
- /* Enumerate visibility settings.  This is deliberately ordered from most
-    to least visibility.  */
- #ifndef SYMBOL_VISIBILITY_DEFINED
- #define SYMBOL_VISIBILITY_DEFINED
- enum symbol_visibility
- {
-   VISIBILITY_DEFAULT,
-   VISIBILITY_PROTECTED,
-   VISIBILITY_HIDDEN,
-   VISIBILITY_INTERNAL
- };
- #endif
- 
  /* Enumerate Objective-c instance variable visibility settings. */
  
  enum ivar_visibility
--- 91,96 ----
Index: tree-core.h
===================================================================
*** tree-core.h	(revision 224292)
--- tree-core.h	(working copy)
*************** enum cv_qualifier {
*** 431,447 ****
    TYPE_QUAL_ATOMIC   = 0x8
  };
  
- /* Enumerate visibility settings.  */
- #ifndef SYMBOL_VISIBILITY_DEFINED
- #define SYMBOL_VISIBILITY_DEFINED
- enum symbol_visibility {
-   VISIBILITY_DEFAULT,
-   VISIBILITY_PROTECTED,
-   VISIBILITY_HIDDEN,
-   VISIBILITY_INTERNAL
- };
- #endif  // SYMBOL_VISIBILITY_DEFINED
- 
  /* Standard named or nameless data types of the C compiler.  */
  enum tree_index {
    TI_ERROR_MARK,
--- 431,436 ----

Reply via email to