Bladeren bron

Provide inline linkage for non-gcc compilers(like clang)

Inline method in headers should be declared extern.
Marius Zbihlei 13 jaren geleden
bovenliggende
commit
2e5145ecdd
3 gewijzigde bestanden met toevoegingen van 9 en 9 verwijderingen
  1. 6 6
      lib/srdb1/db_res.h
  2. 2 2
      lib/srdb1/db_row.h
  3. 1 1
      modules/ctl/binrpc_run.c

+ 6 - 6
lib/srdb1/db_res.h

@@ -85,7 +85,7 @@ typedef struct db1_res {
  * \param _r the result that should be released
  * \return zero on success, negative on errors
  */
-inline int db_free_rows(db1_res_t* _r);
+extern inline int db_free_rows(db1_res_t* _r);
 
 
 /**
@@ -95,20 +95,20 @@ inline int db_free_rows(db1_res_t* _r);
  * \param _r the result that should be released
  * \return zero on success, negative on errors
  */
-inline int db_free_columns(db1_res_t* _r);
+extern inline int db_free_columns(db1_res_t* _r);
 
 
 /**
  * Create a new result structure and initialize it.
  * \return a pointer to the new result on success, NULL on errors
  */
-inline db1_res_t* db_new_result(void);
+extern inline db1_res_t* db_new_result(void);
 
 /**
  * Release memory used by a result structure.
  * \return zero on success, negative on errors
  */
-inline int db_free_result(db1_res_t* _r);
+extern inline int db_free_result(db1_res_t* _r);
 
 /**
  * Allocate storage for column names and type in existing result structure.
@@ -118,7 +118,7 @@ inline int db_free_result(db1_res_t* _r);
  * \param cols number of columns
  * \return zero on success, negative on errors
  */
-inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
+extern inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
 
 
 /**
@@ -126,6 +126,6 @@ inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
  * \param _res result set
  * \return zero on success, negative on errors
  */
-inline int db_allocate_rows(db1_res_t* _res);
+extern inline int db_allocate_rows(db1_res_t* _res);
 
 #endif /* DB1_RES_H */

+ 2 - 2
lib/srdb1/db_row.h

@@ -62,7 +62,7 @@ typedef struct db_row {
  * \param _r row that should be released
  * \return zero on success, negative on error
  */
-inline int db_free_row(db_row_t* _r);
+extern inline int db_free_row(db_row_t* _r);
 
 
 /**
@@ -71,6 +71,6 @@ inline int db_free_row(db_row_t* _r);
  * \param _row filled row
  * \return zero on success, negative on errors
  */
-inline int db_allocate_row(const db1_res_t* _res, db_row_t* _row);
+extern inline int db_allocate_row(const db1_res_t* _res, db_row_t* _row);
 
 #endif /* DB1_ROW_H */

+ 1 - 1
modules/ctl/binrpc_run.c

@@ -384,7 +384,7 @@ end:
 
 
 
-inline void destroy_binrpc_ctx(struct binrpc_ctx* ctx)
+static inline void destroy_binrpc_ctx(struct binrpc_ctx* ctx)
 {
 	free_structs(&ctx->out.structs);
 	if (ctx->out.pkt.body){