Skip to content

Commit 925de3f

Browse files
committed
[gp_stats_collector] Change pragma once to define
1 parent 1945712 commit 925de3f

11 files changed

Lines changed: 44 additions & 15 deletions

File tree

gpcontrib/gp_stats_collector/src/Config.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef CONFIG_H
29+
#define CONFIG_H
2930

3031
#include <memory>
3132
#include <string>
@@ -69,3 +70,5 @@ class Config {
6970
int min_analyze_time_;
7071
int logging_mode_;
7172
};
73+
74+
#endif /* CONFIG_H */

gpcontrib/gp_stats_collector/src/EventSender.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef EVENTSENDER_H
29+
#define EVENTSENDER_H
2930

3031
#include <memory>
3132
#include <unordered_map>
@@ -165,4 +166,5 @@ class EventSender {
165166
std::unordered_map<QueryKey, QueryItem> queries;
166167

167168
Config config;
168-
};
169+
};
170+
#endif /* EVENTSENDER_H */

gpcontrib/gp_stats_collector/src/GpscStat.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef GPSCSTAT_H
29+
#define GPSCSTAT_H
2930

3031
#include <cstdint>
3132

@@ -45,4 +46,5 @@ class GpscStat {
4546
static void report_error();
4647
static Data get_stats();
4748
static bool loaded();
48-
};
49+
};
50+
#endif /* GPSCSTAT_H */

gpcontrib/gp_stats_collector/src/ProcStats.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef PROCSTATS_H
29+
#define PROCSTATS_H
2930

3031
namespace gpsc {
3132
class SystemStat;
3233
}
3334

34-
void fill_self_stats(gpsc::SystemStat *stats);
35+
void fill_self_stats(gpsc::SystemStat *stats);
36+
#endif /* PROCSTATS_H */

gpcontrib/gp_stats_collector/src/ProtoUtils.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef PROTOUTILS_H
29+
#define PROTOUTILS_H
2930

3031
#include "protos/gpsc_set_service.pb.h"
3132

@@ -52,3 +53,5 @@ gpsc::SetQueryReq create_query_req(gpsc::QueryStatus status);
5253
double protots_to_double(const google::protobuf::Timestamp &ts);
5354
void set_analyze_plan_text(QueryDesc *query_desc, gpsc::SetQueryReq *message,
5455
const Config &config);
56+
57+
#endif /* PROTOUTILS_H */

gpcontrib/gp_stats_collector/src/UDSConnector.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef UDSCONNECTOR_H
29+
#define UDSCONNECTOR_H
2930

3031
#include "protos/gpsc_set_service.pb.h"
3132

@@ -36,3 +37,5 @@ class UDSConnector {
3637
bool static report_query(const gpsc::SetQueryReq &req,
3738
const std::string &event, const Config &config);
3839
};
40+
41+
#endif /* UDSCONNECTOR_H */

gpcontrib/gp_stats_collector/src/hook_wrappers.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef HOOK_WRAPPERS_H
29+
#define HOOK_WRAPPERS_H
2930

3031
#ifdef __cplusplus
3132
extern "C" {
@@ -45,4 +46,5 @@ extern void test_uds_stop_server();
4546

4647
#ifdef __cplusplus
4748
}
48-
#endif
49+
#endif
50+
#endif /* HOOK_WRAPPERS_H */

gpcontrib/gp_stats_collector/src/log/LogOps.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef LOGOPS_H
29+
#define LOGOPS_H
2930

3031
#include <string>
3132

@@ -44,3 +45,5 @@ void truncate_log();
4445

4546
/* INSERT INTO gpsc.__log VALUES (...) */
4647
void insert_log(const gpsc::SetQueryReq &req, bool utility);
48+
49+
#endif /* LOGOPS_H */

gpcontrib/gp_stats_collector/src/log/LogSchema.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef LOGSCHEMA_H
29+
#define LOGSCHEMA_H
2930

3031
#include <array>
3132
#include <string>
@@ -191,3 +192,5 @@ void process_field(const google::protobuf::FieldDescriptor *field,
191192
*/
192193
void extract_query_req(const google::protobuf::Message &msg,
193194
const std::string &prefix, Datum *values, bool *nulls);
195+
196+
#endif /* LOGSCHEMA_H */

gpcontrib/gp_stats_collector/src/memory/gpdbwrappers.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*-------------------------------------------------------------------------
2626
*/
2727

28-
#pragma once
28+
#ifndef GPDBWRAPPERS_H
29+
#define GPDBWRAPPERS_H
2930

3031
extern "C" {
3132
#include "postgres.h"
@@ -79,3 +80,5 @@ void list_free(List *list) noexcept;
7980
Oid get_rg_id_by_session_id(int session_id);
8081

8182
} // namespace gpdb
83+
84+
#endif /* GPDBWRAPPERS_H */

0 commit comments

Comments
 (0)