This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit b86dcb9ed139199a71d0dece6fa4384b8b80925b
Author: Andrew Stitcher <[email protected]>
AuthorDate: Thu Jun 29 15:50:29 2023 -0400

    NO-JIRA: Make pn_bytes()/pn_rwbytes() inlinable
---
 c/include/proton/types.h | 12 ++++++++++--
 c/src/core/types.c       | 13 ++-----------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/c/include/proton/types.h b/c/include/proton/types.h
index becf3fa63..2fed2b74d 100644
--- a/c/include/proton/types.h
+++ b/c/include/proton/types.h
@@ -223,7 +223,11 @@ typedef struct pn_bytes_t {
  *
  * @ingroup api_types
  */
-PN_EXTERN pn_bytes_t pn_bytes(size_t size, const char *start);
+PN_EXTERN inline pn_bytes_t pn_bytes(size_t size, const char *start)
+{
+  pn_bytes_t bytes = {size, start};
+  return bytes;
+}
 
 PN_EXTERN extern const pn_bytes_t pn_bytes_null;
 
@@ -242,7 +246,11 @@ typedef struct pn_rwbytes_t {
  *
  * @ingroup api_types
  */
-PN_EXTERN pn_rwbytes_t pn_rwbytes(size_t size, char *start);
+PN_EXTERN inline pn_rwbytes_t pn_rwbytes(size_t size, char *start)
+{
+  pn_rwbytes_t bytes = {size, start};
+  return bytes;
+}
 
 PN_EXTERN extern const pn_rwbytes_t pn_rwbytes_null;
 
diff --git a/c/src/core/types.c b/c/src/core/types.c
index 0ca2bfc32..fc64b38cb 100644
--- a/c/src/core/types.c
+++ b/c/src/core/types.c
@@ -24,14 +24,5 @@
 const pn_bytes_t pn_bytes_null = { 0, NULL };
 const pn_rwbytes_t pn_rwbytes_null = { 0, NULL };
 
-pn_bytes_t pn_bytes(size_t size, const char *start)
-{
-  pn_bytes_t bytes = {size, start};
-  return bytes;
-}
-
-pn_rwbytes_t pn_rwbytes(size_t size, char *start)
-{
-  pn_rwbytes_t bytes = {size, start};
-  return bytes;
-}
+extern inline pn_bytes_t pn_bytes(size_t size, const char *start);
+extern inline pn_rwbytes_t pn_rwbytes(size_t size, char *start);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to