Skip to content

Commit 47f99dc

Browse files
vfjplalanxz
authored andcommitted
convert amqp_bytes_from_buffer function to macro
1 parent 658342c commit 47f99dc

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

include/rabbitmq-c/amqp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,7 @@ amqp_bytes_t AMQP_CALL amqp_cstring_bytes(char const *cstr);
899899
*
900900
* \since v0.16
901901
*/
902-
AMQP_EXPORT
903-
amqp_bytes_t AMQP_CALL amqp_bytes_from_buffer(void const *ptr, size_t length);
902+
#define amqp_bytes_from_buffer(ptr, length) (amqp_bytes_t){length, (void *)ptr}
904903

905904
/**
906905
* Duplicates an amqp_bytes_t buffer.

librabbitmq/amqp_mem.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ amqp_bytes_t amqp_cstring_bytes(char const *cstr) {
138138
result.bytes = (void *)cstr;
139139
return result;
140140
}
141-
amqp_bytes_t amqp_bytes_from_buffer(void const *ptr, size_t length) {
142-
amqp_bytes_t result;
143-
result.len = length;
144-
result.bytes = (void *)ptr;
145-
return result;
146-
}
147141

148142
amqp_bytes_t amqp_bytes_malloc_dup(amqp_bytes_t src) {
149143
amqp_bytes_t result;

0 commit comments

Comments
 (0)