diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2012-05-21 14:31:58 -0400 |
---|---|---|
committer | Michael Steinert <mike.steinert@gmail.com> | 2012-05-23 09:18:05 -0600 |
commit | a1de9945125b9c06cdeb11e713258717b3179234 (patch) | |
tree | da516ac143386317ae35eb31badbcb3860eab902 /librabbitmq/codegen.py | |
parent | 2f13e2e8c84f65d698830b7bc28591438b7176d5 (diff) | |
download | rabbitmq-c-github-ask-a1de9945125b9c06cdeb11e713258717b3179234.tar.gz |
Cleaning up Public API decorators on Win32
Removed duplicate #defines of AMQP_PUBLIC/AMQP_PRIVATE in amqp.h &
amqp_private.h
Split AMQP_PUBLIC into AMQP_PUBLIC_FUNCTION and AMQP_PUBLIC_VARIABLE
Added AMQP_CALL to specify calling convention (__cdecl by default)
Added -DAMQP_BUILD when building the library
Added -DAMQP_STATIC when building the library statically
(this is still incomplete on Win32, a installable amqp_config.h is
required)
Diffstat (limited to 'librabbitmq/codegen.py')
-rw-r--r-- | librabbitmq/codegen.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/librabbitmq/codegen.py b/librabbitmq/codegen.py index f805751..42d039d 100644 --- a/librabbitmq/codegen.py +++ b/librabbitmq/codegen.py @@ -250,7 +250,7 @@ def methodApiPrototype(m): args.append(" ") args.append(n) - return "%s_ok_t *%s(amqp_connection_state_t state, amqp_channel_t channel%s)" % (fn, fn, ''.join(args)) + return "AMQP_PUBLIC_FUNCTION %s_ok_t * AMQP_CALL %s(amqp_connection_state_t state, amqp_channel_t channel%s)" % (fn, fn, ''.join(args)) AmqpMethod.apiPrototype = methodApiPrototype @@ -570,45 +570,45 @@ AMQP_BEGIN_DECLS print """/* Function prototypes. */ -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION char const * -amqp_constant_name(int constantNumber); +AMQP_CALL amqp_constant_name(int constantNumber); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION amqp_boolean_t -amqp_constant_is_hard_error(int constantNumber); +AMQP_CALL amqp_constant_is_hard_error(int constantNumber); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION char const * -amqp_method_name(amqp_method_number_t methodNumber); +AMQP_CALL amqp_method_name(amqp_method_number_t methodNumber); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION amqp_boolean_t -amqp_method_has_content(amqp_method_number_t methodNumber); +AMQP_CALL amqp_method_has_content(amqp_method_number_t methodNumber); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION int -amqp_decode_method(amqp_method_number_t methodNumber, +AMQP_CALL amqp_decode_method(amqp_method_number_t methodNumber, amqp_pool_t *pool, amqp_bytes_t encoded, void **decoded); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION int -amqp_decode_properties(uint16_t class_id, - amqp_pool_t *pool, - amqp_bytes_t encoded, - void **decoded); +AMQP_CALL amqp_decode_properties(uint16_t class_id, + amqp_pool_t *pool, + amqp_bytes_t encoded, + void **decoded); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION int -amqp_encode_method(amqp_method_number_t methodNumber, +AMQP_CALL amqp_encode_method(amqp_method_number_t methodNumber, void *decoded, amqp_bytes_t encoded); -AMQP_PUBLIC +AMQP_PUBLIC_FUNCTION int -amqp_encode_properties(uint16_t class_id, +AMQP_CALL amqp_encode_properties(uint16_t class_id, void *decoded, amqp_bytes_t encoded); """ @@ -647,7 +647,7 @@ amqp_encode_properties(uint16_t class_id, for m in methods: if m.isSynchronous and apiMethodInfo.get(m.fullName()) is not False: - print "AMQP_PUBLIC\n%s;" % (m.apiPrototype(),) + print "%s;" % (m.apiPrototype(),) print """ AMQP_END_DECLS |