Skip to content

Commit

Permalink
ldns: fix the build in FreeBSD's base system
Browse files Browse the repository at this point in the history
This adds a copy of the function prototypes for internal functions where
necessary.

It effectively works around the following compilation error:
error: no previous prototype for function [-Werror,-Wmissing-prototypes]

Tested on FreeBSD/amd64 (14.0-CURRENT).
  • Loading branch information
khorben committed May 22, 2023
1 parent 0ede967 commit 2779d15
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dnssec_zone.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,6 @@ ldns_todo_nsec3_ents_node_free(ldns_rbnode_t *node, void *arg) {
LDNS_FREE(node);
}

ldns_status _ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev,
int *line_nr, bool *explicit_ttl);

ldns_status
ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, const ldns_rdf* origin,
uint32_t default_ttl, ldns_rr_class ATTR_UNUSED(c), int* line_nr)
Expand Down Expand Up @@ -1914,6 +1910,9 @@ rr_list2dnssec_rrs(ldns_rr_list *rr_list, ldns_dnssec_rrs **rrs,
}


ldns_status
dnssec_zone_equip_zonemd(ldns_dnssec_zone *zone,
ldns_rr_list *new_rrs, ldns_key_list *key_list, int signflags);
ldns_status
dnssec_zone_equip_zonemd(ldns_dnssec_zone *zone,
ldns_rr_list *new_rrs, ldns_key_list *key_list, int signflags)
Expand Down
6 changes: 3 additions & 3 deletions edns.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@ ldns_edns_get_wireformat_buffer(const ldns_edns_option *edns)
}

/* write */
void
static void
ldns_edns_set_size(ldns_edns_option *edns, size_t size)
{
assert(edns != NULL);
edns->_size = size;
}

void
static void
ldns_edns_set_code(ldns_edns_option *edns, ldns_edns_option_code code)
{
assert(edns != NULL);
edns->_code = code;
}

void
static void
ldns_edns_set_data(ldns_edns_option *edns, void *data)
{
/* only copy the pointer */
Expand Down
2 changes: 2 additions & 0 deletions packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@ ldns_pkt_edns(const ldns_pkt *pkt)
);
}

ldns_edns_option_list*
pkt_edns_data2edns_option_list(const ldns_rdf *edns_data);
ldns_edns_option_list*
pkt_edns_data2edns_option_list(const ldns_rdf *edns_data)
{
Expand Down
4 changes: 4 additions & 0 deletions rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin,
return ldns_rr_new_frm_fp_l(newrr, fp, ttl, origin, prev, NULL);
}

ldns_status
_ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev,
int *line_nr, bool *explicit_ttl);
ldns_status
_ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev,
Expand Down
2 changes: 1 addition & 1 deletion str2host.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@ static const size_t svcparam_key_defs_len = sizeof(svcparam_key_defs)
/* svcparam_key2buffer_str() should actually be in host2str.c, but we need the
* svcparam_key_defs for it and it is not an exposed symbol anyway.
*/
ldns_status svcparam_key2buffer_str(ldns_buffer *output, uint16_t key)
static ldns_status svcparam_key2buffer_str(ldns_buffer *output, uint16_t key)
{
if (key <= LDNS_SVCPARAM_KEY_LAST_KEY)
ldns_buffer_write_string(output, svcparam_key_defs[key].str);
Expand Down
2 changes: 2 additions & 0 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result)
#endif
/* alias function because of previously used wrong spelling */
struct tm *
ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result);
struct tm *
ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result)
{
return ldns_serial_arithmetics_gmtime_r(time, now, result);
Expand Down

0 comments on commit 2779d15

Please sign in to comment.