NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Minor problems building netbsd-6 with clang



Hello,

   I ran into a few minor issues (two oldies, but one new) when I
upgraded the netbsd-6 branch and tried to build the system.

   Random notes:
   - I cleaned out the build directories completely before starting the
new build.
   - NetBSD/amd64
   - Using the fossil repository

   First; __libc_thr_exit_stud() isn't dead, and clang is unhappy about
that; see
http://mail-index.netbsd.org/netbsd-bugs/2014/05/05/msg036583.html.

   Next; clang appears to not be satisfied with having "inline" on
forward declarations.  See inline_for_clang.diff.

   Then I encountered this:
https://mail-index.netbsd.org/tech-toolchain/2009/12/22/msg000935.html
(though only for configdoc.texi, and the "touch" workaround,
unsurprisingly, works).


-- 
Kind Regards,
Jan
Index: external/bsd/ntp/dist/sntp/libevent/minheap-internal.h
==================================================================
--- external/bsd/ntp/dist/sntp/libevent/minheap-internal.h
+++ external/bsd/ntp/dist/sntp/libevent/minheap-internal.h
@@ -61,26 +61,26 @@
 static inline void	     min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct event* e);
 
 #define min_heap_elem_greater(a, b) \
 	(evutil_timercmp(&(a)->ev_timeout, &(b)->ev_timeout, >))
 
-void min_heap_ctor_(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }
-void min_heap_dtor_(min_heap_t* s) { if (s->p) mm_free(s->p); }
-void min_heap_elem_init_(struct event* e) { e->ev_timeout_pos.min_heap_idx = -1; }
-int min_heap_empty_(min_heap_t* s) { return 0u == s->n; }
-unsigned min_heap_size_(min_heap_t* s) { return s->n; }
-struct event* min_heap_top_(min_heap_t* s) { return s->n ? *s->p : 0; }
+inline void min_heap_ctor_(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; }
+inline void min_heap_dtor_(min_heap_t* s) { if (s->p) mm_free(s->p); }
+inline void min_heap_elem_init_(struct event* e) { e->ev_timeout_pos.min_heap_idx = -1; }
+inline int min_heap_empty_(min_heap_t* s) { return 0u == s->n; }
+inline unsigned min_heap_size_(min_heap_t* s) { return s->n; }
+inline struct event* min_heap_top_(min_heap_t* s) { return s->n ? *s->p : 0; }
 
 int min_heap_push_(min_heap_t* s, struct event* e)
 {
 	if (min_heap_reserve_(s, s->n + 1))
 		return -1;
 	min_heap_shift_up_(s, s->n++, e);
 	return 0;
 }
 
-struct event* min_heap_pop_(min_heap_t* s)
+inline struct event* min_heap_pop_(min_heap_t* s)
 {
 	if (s->n)
 	{
 		struct event* e = *s->p;
 		min_heap_shift_down_(s, 0u, s->p[--s->n]);
@@ -88,16 +88,16 @@
 		return e;
 	}
 	return 0;
 }
 
-int min_heap_elt_is_top_(const struct event *e)
+inline int min_heap_elt_is_top_(const struct event *e)
 {
 	return e->ev_timeout_pos.min_heap_idx == 0;
 }
 
-int min_heap_erase_(min_heap_t* s, struct event* e)
+inline int min_heap_erase_(min_heap_t* s, struct event* e)
 {
 	if (-1 != e->ev_timeout_pos.min_heap_idx)
 	{
 		struct event *last = s->p[--s->n];
 		unsigned parent = (e->ev_timeout_pos.min_heap_idx - 1) / 2;
@@ -114,11 +114,11 @@
 		return 0;
 	}
 	return -1;
 }
 
-int min_heap_adjust_(min_heap_t *s, struct event *e)
+inline int min_heap_adjust_(min_heap_t *s, struct event *e)
 {
 	if (-1 == e->ev_timeout_pos.min_heap_idx) {
 		return min_heap_push_(s, e);
 	} else {
 		unsigned parent = (e->ev_timeout_pos.min_heap_idx - 1) / 2;



Home | Main Index | Thread Index | Old Index