Skip to content

Commit 7b1c452

Browse files
fix(build): avoid redefining typedefs
@morgando found that 8f5cdab prevents clang from compiling the project because `tran_type` is redefined (interestingly, gcc did not complain about this). Avoid redefining typedefs by including the necessary headers and do the same for `uuid_t`. Signed-off-by: Shoumyo Chakravorti <schakravorti@bloomberg.net>
1 parent bb605d2 commit 7b1c452

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

db/comdb2uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
#include <uuid/uuid.h>
17+
#include "comdb2uuid.h"
1818

1919
void comdb2uuid(uuid_t u) { uuid_generate(u); }
2020

db/comdb2uuid.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#ifndef INCLUDED_COMDB2_UUID_H
1818
#define INCLUDED_COMDB2_UUID_H
1919

20-
typedef unsigned char uuid_t[16];
20+
#include <uuid/uuid.h>
21+
2122
typedef char uuidstr_t[37];
2223

2324
void comdb2uuid(uuid_t u);

schemachange/sc_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int seed_qsort_cmpfunc(const void *key1, const void *key2)
225225
}
226226

227227
// keep only last N sc history entries
228-
int trim_sc_history_entries(tran_type *tran, const char *tablename)
228+
int trim_sc_history_entries(struct tran_tag *tran, const char *tablename)
229229
{
230230
int rc = 0, bdberr, nkeys;
231231
sc_hist_row *hist = NULL;

schemachange/sc_util.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
struct dbtable;
2323
struct tran_tag;
24-
typedef struct tran_tag tran_type;
2524

2625
int close_all_dbs(void);
2726
int open_all_dbs(void);
@@ -54,6 +53,6 @@ int sc_via_ddl_only();
5453
void set_schema_change_in_progress(const char *func, int line, int val);
5554

5655
int get_schema_change_in_progress(const char *func, int line);
57-
int trim_sc_history_entries(tran_type *tran, const char *tablename);
56+
int trim_sc_history_entries(struct tran_tag *tran, const char *tablename);
5857

5958
#endif

0 commit comments

Comments
 (0)