[RFA] add include guards

Message ID 20171123164802.11125-1-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Nov. 23, 2017, 4:48 p.m. UTC
  Oops, my previous patch neglected this bit -- I forgot I noticed that
format.h doesn't have header guards, so I had an earlier patch to add
these.

---
 gdb/common/format.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Simon Marchi Nov. 23, 2017, 7:33 p.m. UTC | #1
On 2017-11-23 11:48 AM, Tom Tromey wrote:
> Oops, my previous patch neglected this bit -- I forgot I noticed that
> format.h doesn't have header guards, so I had an earlier patch to add
> these.
> 
> ---
>  gdb/common/format.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/gdb/common/format.h b/gdb/common/format.h
> index 33afc3a3f4..f3a94b8bbb 100644
> --- a/gdb/common/format.h
> +++ b/gdb/common/format.h
> @@ -17,6 +17,9 @@
>     You should have received a copy of the GNU General Public License
>     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>  
> +#ifndef COMMON_FORMAT_H
> +#define COMMON_FORMAT_H
> +
>  #if defined(__MINGW32__) && !defined(PRINTF_HAS_LONG_LONG)
>  # define USE_PRINTF_I64 1
>  # define PRINTF_HAS_LONG_LONG
> @@ -62,3 +65,5 @@ extern void free_format_pieces (struct format_piece *frags);
>  /* Freeing, cast as a cleanup.  */
>  
>  extern void free_format_pieces_cleanup (void *);
> +
> +#endif /* COMMON_FORMAT_H */
> 

I think you can push this one right away.

Simon
  

Patch

diff --git a/gdb/common/format.h b/gdb/common/format.h
index 33afc3a3f4..f3a94b8bbb 100644
--- a/gdb/common/format.h
+++ b/gdb/common/format.h
@@ -17,6 +17,9 @@ 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef COMMON_FORMAT_H
+#define COMMON_FORMAT_H
+
 #if defined(__MINGW32__) && !defined(PRINTF_HAS_LONG_LONG)
 # define USE_PRINTF_I64 1
 # define PRINTF_HAS_LONG_LONG
@@ -62,3 +65,5 @@  extern void free_format_pieces (struct format_piece *frags);
 /* Freeing, cast as a cleanup.  */
 
 extern void free_format_pieces_cleanup (void *);
+
+#endif /* COMMON_FORMAT_H */