mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Try a different approach to making publish function seem used.
We want the DISPATCH_ADD_PUB() macro to count as making a DECLARE_PUBLISH() invocation "used", so let's try a new approach that preserves that idea. The old one apparently did not work for some versions of osx clang.
This commit is contained in:
parent
94feec59cf
commit
beedadbeac
@ -268,12 +268,20 @@
|
||||
} \
|
||||
EAT_SEMICOLON
|
||||
|
||||
/**
|
||||
* Add a fake use of the publish function for 'messagename', so that
|
||||
* the compiler does not call it unused.
|
||||
*/
|
||||
#define DISPATCH__FAKE_USE_OF_PUBFN_(messagename) \
|
||||
( 0 ? (publish_fn__ ##messagename((msg_arg_type__##messagename)0), 1) \
|
||||
: 1)
|
||||
|
||||
/*
|
||||
* This macro is for internal use. It backs DISPATCH_ADD_PUB*()
|
||||
*/
|
||||
#define DISPATCH_ADD_PUB_(connector, channel, messagename, flags) \
|
||||
( \
|
||||
((void)publish_fn__ ##messagename), \
|
||||
DISPATCH__FAKE_USE_OF_PUBFN_(messagename), \
|
||||
pubsub_add_pub_((connector), \
|
||||
&pub_binding__ ##messagename, \
|
||||
get_channel_id(# channel), \
|
||||
|
Loading…
Reference in New Issue
Block a user