summaryrefslogtreecommitdiff
path: root/ham/linpsk/files/pkgsrc_fixes.h
blob: 3901ccc2da30b53d8624a062b7d9b8da4f601f39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef LINPSK_PKGSRC_FIXES_H
#define LINPSK_PKGSRC_FIXES_H

#ifdef __NetBSD__
# include <sys/param.h>
#endif
#if !(defined(__NetBSD__) && __NetBSD_Version__ < 200000000)
# define HAVE_STRUCT_SCHED_PARAM
#endif

#if !(defined(__GNUC__) && (__GNUC__ < 3))
#  define HAVE_STD_VECTOR_AT
#endif

#ifdef __cplusplus
template <class T> typename T::reference at_replacement(T &c, const typename T::size_type &i) {
# ifdef HAVE_STD_VECTOR_AT
	return c.at(i);
# else
	return c[i];
# endif
}
#endif

#endif