summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-03-11 15:33:59 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-03-11 15:33:59 +0200
commit33c30da165506a18591cc51cd08ec9f9ca3b13a8 (patch)
tree272404edadf191979917a37e1891116555f35f59 /include
parent3c9f415e529e4e3dc9948b8df0ede75f628a8805 (diff)
downloadmariadb-git-33c30da165506a18591cc51cd08ec9f9ca3b13a8.tar.gz
Fix clang -Wtypedef-redefinition
Fixup for commit 77c184df7c056da7364e606ac977cc2d3cd826ad
Diffstat (limited to 'include')
-rw-r--r--include/my_alloc.h2
-rw-r--r--include/mysql.h.pp2
-rw-r--r--include/mysql/psi/psi_abi_v1.h.pp2
-rw-r--r--include/mysql/psi/psi_abi_v2.h.pp2
-rw-r--r--include/mysql/psi/psi_base.h7
-rw-r--r--include/mysql/psi/psi_memory.h7
6 files changed, 12 insertions, 10 deletions
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 659cc16ea14..944dcb6e1bd 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -20,7 +20,7 @@
#ifndef _my_alloc_h
#define _my_alloc_h
-typedef unsigned int PSI_memory_key;
+#include "mysql/psi/psi_base.h"
#define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 7ae47ac836e..81b6206ae3e 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -238,7 +238,9 @@ typedef struct st_mysql_field {
typedef char **MYSQL_ROW;
typedef unsigned int MYSQL_FIELD_OFFSET;
typedef unsigned long long my_ulonglong;
+extern "C" {
typedef unsigned int PSI_memory_key;
+}
extern "C" {
typedef struct st_used_mem
{
diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp
index a1845ac62f6..ad2bf1d21dc 100644
--- a/include/mysql/psi/psi_abi_v1.h.pp
+++ b/include/mysql/psi/psi_abi_v1.h.pp
@@ -1,8 +1,8 @@
extern "C" {
+typedef unsigned int PSI_memory_key;
}
extern "C" {
struct PSI_thread;
-typedef unsigned int PSI_memory_key;
struct PSI_memory_info_v1
{
PSI_memory_key *m_key;
diff --git a/include/mysql/psi/psi_abi_v2.h.pp b/include/mysql/psi/psi_abi_v2.h.pp
index a670e53a8b7..9188954885f 100644
--- a/include/mysql/psi/psi_abi_v2.h.pp
+++ b/include/mysql/psi/psi_abi_v2.h.pp
@@ -1,8 +1,8 @@
extern "C" {
+typedef unsigned int PSI_memory_key;
}
extern "C" {
struct PSI_thread;
-typedef unsigned int PSI_memory_key;
struct PSI_memory_info_v2
{
int placeholder;
diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h
index 7b4eaf80892..2bb1d8fc354 100644
--- a/include/mysql/psi/psi_base.h
+++ b/include/mysql/psi/psi_base.h
@@ -164,6 +164,13 @@ extern "C" {
/** @} */
+/**
+ Instrumented memory key.
+ To instrument memory, a memory key must be obtained using @c register_memory.
+ Using a zero key always disable the instrumentation.
+*/
+typedef unsigned int PSI_memory_key;
+
#ifdef __cplusplus
}
#endif
diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h
index 9b968667d53..60d68f1a6dd 100644
--- a/include/mysql/psi/psi_memory.h
+++ b/include/mysql/psi/psi_memory.h
@@ -53,13 +53,6 @@ extern "C" {
struct PSI_thread;
-/**
- Instrumented memory key.
- To instrument memory, a memory key must be obtained using @c register_memory.
- Using a zero key always disable the instrumentation.
-*/
-typedef unsigned int PSI_memory_key;
-
#ifdef HAVE_PSI_1
/**