Skip to content

Commit

Permalink
Use "#pragma once" instead of include guard
Browse files Browse the repository at this point in the history
Because "#pragma once" is sufficiency portable.

https://en.wikipedia.org/wiki/Pragma_once#Portability says the following
compiler supports "#pragma once":

  * Clang
  * Comeau C/C++
  * C++Builder XE3
  * Digital Mars C++
  * GCC
  * HP C/aC++
  * IBM XL C/C++
  * Intel C++ Compiler
  * Microsoft Visual C++
  * Pelles C
  * ARM DS-5
  * IAR C/C++

"Solaris Studio C/C++" doesn't support "#pragma once" but we don't
support "Solaris Studio C/C++".
  • Loading branch information
kou committed Jan 12, 2016
1 parent b0d4cdf commit 7c488ff
Show file tree
Hide file tree
Showing 134 changed files with 353 additions and 653 deletions.
8 changes: 3 additions & 5 deletions include/groonga.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2014-2015 Brazil
Copyright(C) 2014-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_H
#define GROONGA_H

#pragma once

#include "groonga/portability.h"
#include "groonga/groonga.h"
Expand All @@ -32,5 +32,3 @@
#include "groonga/windows.h"
#include "groonga/windows_event_logger.h"
#include "groonga/file_reader.h"

#endif /* GROONGA_H */
8 changes: 3 additions & 5 deletions include/groonga/command.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_COMMAND_H
#define GROONGA_COMMAND_H

#pragma once

#include <groonga/plugin.h>

Expand Down Expand Up @@ -77,5 +77,3 @@ GRN_PLUGIN_EXPORT grn_rc grn_command_run(grn_ctx *ctx,
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif /* GROONGA_COMMAND_H */
7 changes: 2 additions & 5 deletions include/groonga/conf.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,8 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef GRN_CONF_H
#define GRN_CONF_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -38,5 +37,3 @@ GRN_API grn_rc grn_conf_get(grn_ctx *ctx,
#ifdef __cplusplus
}
#endif

#endif /* GRN_CONF_H */
8 changes: 3 additions & 5 deletions include/groonga/expr.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2009-2015 Brazil
Copyright(C) 2009-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_EXPR_H
#define GROONGA_EXPR_H

#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -107,5 +107,3 @@ GRN_API unsigned int grn_expr_estimate_size(grn_ctx *ctx, grn_obj *expr);
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_EXPR_H */
7 changes: 2 additions & 5 deletions include/groonga/file_reader.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,8 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef GROONGA_FILE_READER_H
#define GROONGA_FILE_READER_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -36,5 +35,3 @@ GRN_API grn_rc grn_file_reader_read_line(grn_ctx *ctx,
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_FILE_READER_H */
7 changes: 2 additions & 5 deletions include/groonga/geo.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -17,8 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef GROONGA_GEO_H
#define GROONGA_GEO_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -35,5 +34,3 @@ GRN_API int grn_geo_table_sort(grn_ctx *ctx,
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_GEO_H */
8 changes: 3 additions & 5 deletions include/groonga/groonga.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2009-2015 Brazil
Copyright(C) 2009-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_GROONGA_H
#define GROONGA_GROONGA_H

#pragma once

#include <stdarg.h>
#include <sys/types.h>
Expand Down Expand Up @@ -2044,5 +2044,3 @@ GRN_API grn_rc grn_dat_cursor_delete(grn_ctx *ctx, grn_dat_cursor *c,
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_GROONGA_H */
8 changes: 3 additions & 5 deletions include/groonga/ii.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2009-2014 Brazil
Copyright(C) 2009-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_II_H
#define GROONGA_II_H

#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -57,5 +57,3 @@ GRN_API grn_rc grn_ii_cursor_close(grn_ctx *ctx, grn_ii_cursor *c);
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_II_H */
9 changes: 4 additions & 5 deletions include/groonga/nfkc.h
@@ -1,5 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/* Copyright(C) 2009 Brazil
/*
Copyright(C) 2009-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -14,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_NFKC_H
#define GROONGA_NFKC_H

#pragma once

#include <groonga.h>

Expand All @@ -28,5 +29,3 @@ GRN_API grn_char_type grn_nfkc_char_type(const unsigned char *str);
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_NFKC_H */
8 changes: 3 additions & 5 deletions include/groonga/normalizer.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2012 Brazil
Copyright(C) 2012-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_NORMALIER_H
#define GROONGA_NORMALIER_H

#pragma once

#include <stddef.h>

Expand Down Expand Up @@ -51,5 +51,3 @@ GRN_PLUGIN_EXPORT grn_rc grn_normalizer_register(grn_ctx *ctx,
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif /* GROONGA_NORMALIER_H */
8 changes: 3 additions & 5 deletions include/groonga/obj.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,8 +16,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_OBJ_H
#define GROONGA_OBJ_H

#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -54,5 +54,3 @@ GRN_API grn_rc grn_obj_reindex(grn_ctx *ctx, grn_obj *obj);
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_OBJ_H */
8 changes: 3 additions & 5 deletions include/groonga/output.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2009-2015 Brazil
Copyright(C) 2009-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_OUTPUT_H
#define GROONGA_OUTPUT_H

#pragma once

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -106,5 +106,3 @@ GRN_API grn_rc grn_text_otoj(grn_ctx *ctx, grn_obj *bulk, grn_obj *obj,
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_OUTPUT_H */
8 changes: 3 additions & 5 deletions include/groonga/plugin.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2010-2014 Brazil
Copyright(C) 2010-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_PLUGIN_H
#define GROONGA_PLUGIN_H

#pragma once

#include <stddef.h>

Expand Down Expand Up @@ -172,5 +172,3 @@ GRN_API grn_obj *grn_plugin_command_create(grn_ctx *ctx,
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_PLUGIN_H */
8 changes: 3 additions & 5 deletions include/groonga/portability.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_PORTABILITY_H
#define GROONGA_PORTABILITY_H

#pragma once

#ifdef WIN32
# ifdef __cplusplus
Expand Down Expand Up @@ -170,5 +170,3 @@
#else /* WIN32 */
# define grn_close(fd) close((fd))
#endif /* WIN32 */

#endif /* GROONGA_PORTABILITY_H */
7 changes: 2 additions & 5 deletions include/groonga/request_canceler.h
@@ -1,5 +1,5 @@
/*
Copyright(C) 2014 Brazil
Copyright(C) 2014-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,8 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef GROONGA_REQUEST_CANCELER_H
#define GROONGA_REQUEST_CANCELER_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -35,5 +34,3 @@ GRN_API grn_bool grn_request_canceler_cancel(const char *request_id,
#ifdef __cplusplus
}
#endif

#endif /* GROONGA_REQUEST_CANCELER_H */
8 changes: 3 additions & 5 deletions include/groonga/scorer.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2015 Brazil
Copyright(C) 2015-2016 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,8 +15,8 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GROONGA_SCORER_H
#define GROONGA_SCORER_H

#pragma once

#include <groonga/plugin.h>

Expand Down Expand Up @@ -91,5 +91,3 @@ GRN_PLUGIN_EXPORT grn_rc grn_scorer_register(grn_ctx *ctx,
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif /* GROONGA_SCORER_H */

0 comments on commit 7c488ff

Please sign in to comment.