mirror of https://github.com/getdnsapi/getdns.git
declare inline functions in a more portable way
Or at least in a way that works without a -O[1-3] flag...
This commit is contained in:
parent
f633886cbf
commit
2be047d48d
|
@ -1810,15 +1810,6 @@ getdns_context_set_eventloop(struct getdns_context* context, getdns_eventloop* l
|
|||
return GETDNS_RETURN_GOOD;
|
||||
}
|
||||
|
||||
static inline getdns_return_t
|
||||
priv_dict_set_list_if_not_null(getdns_dict* dict,
|
||||
const char* name, getdns_list* list) {
|
||||
if (!list) {
|
||||
return GETDNS_RETURN_GOOD;
|
||||
}
|
||||
return getdns_dict_set_list(dict, name, list);
|
||||
}
|
||||
|
||||
static getdns_dict*
|
||||
priv_get_context_settings(getdns_context* context) {
|
||||
getdns_return_t r = GETDNS_RETURN_GOOD;
|
||||
|
@ -1840,7 +1831,7 @@ priv_get_context_settings(getdns_context* context) {
|
|||
r |= getdns_dict_set_int(result, "edns_do_bit", context->edns_do_bit);
|
||||
r |= getdns_dict_set_int(result, "append_name", context->append_name);
|
||||
/* list fields */
|
||||
r |= priv_dict_set_list_if_not_null(result, "suffix", context->suffix);
|
||||
if (context->suffix) r |= getdns_dict_set_list(result, "suffix", context->suffix);
|
||||
if (context->upstreams && context->upstreams->count > 0) {
|
||||
size_t i;
|
||||
getdns_upstream *upstream;
|
||||
|
|
|
@ -35,6 +35,16 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef S_SPLINT_S
|
||||
# define INLINE
|
||||
#else
|
||||
# ifdef SWIG
|
||||
# define INLINE static
|
||||
# else
|
||||
# define INLINE static inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable the return_dnssec_status extension on every request.
|
||||
value is either GETDNS_EXTENSION_TRUE or GETDNS_EXTENSION_FALSE
|
||||
returns GETDNS_RETURN_GOOD on success or GETDNS_RETURN_INVALID_PARAMETER
|
||||
|
@ -82,7 +92,7 @@ typedef struct getdns_eventloop_event {
|
|||
void *ev;
|
||||
} getdns_eventloop_event;
|
||||
|
||||
inline getdns_eventloop_event *getdns_eventloop_event_init(
|
||||
INLINE getdns_eventloop_event *getdns_eventloop_event_init(
|
||||
getdns_eventloop_event *ev,void *userarg, getdns_eventloop_callback read_cb,
|
||||
getdns_eventloop_callback write_cb, getdns_eventloop_callback timeout_cb)
|
||||
{ ev->userarg = userarg; ev->read_cb = read_cb; ev->write_cb = write_cb;
|
||||
|
|
Loading…
Reference in New Issue