Skip to content

Commit bf15c3b

Browse files
committed
[test-suite] Fix NetBSD build
No functional change intended for other OSes. llvm-svn: 349273
1 parent bf9d2f1 commit bf15c3b

File tree

10 files changed

+19
-21
lines changed

10 files changed

+19
-21
lines changed

MultiSource/Applications/JM/ldecod/image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
#include "vlc.h"
6565

66-
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
66+
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
6767
#include <sys/time.h>
6868
int ftime(struct timeb *tp)
6969
{

MultiSource/Applications/JM/lencod/image.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include "output.h"
5252
#include "cabac.h"
5353

54-
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
54+
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
5555
#include <sys/time.h>
5656
int ftime(struct timeb *tp)
5757
{
@@ -2885,5 +2885,3 @@ void read_SP_coefficients()
28852885
}
28862886
fclose(SP_coeff_file);
28872887
}
2888-
2889-

MultiSource/Applications/hexxagon/hexxagonmove.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include <iostream>
2727
#include <stdlib.h>
28-
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
28+
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
2929
#include <sys/time.h>
3030
#else
3131
#include <sys/timeb.h>
@@ -91,7 +91,7 @@ void HexxagonMoveList::sortList()
9191

9292
int getTime()
9393
{
94-
#if defined(__FreeBSD__) || defined(__OpenBSD__ )|| defined(__APPLE__)
94+
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__ ) || defined(__APPLE__)
9595
struct timeval tv;
9696

9797
gettimeofday(&tv, NULL);
@@ -200,7 +200,3 @@ HexxagonMove *HexxagonMoveList::getBestMove()
200200

201201
return NULL;
202202
}
203-
204-
205-
206-

MultiSource/Applications/minisat/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static inline int memReadStat(int field)
6565
static inline uint64_t memUsed() { return (uint64_t)memReadStat(0) * (uint64_t)getpagesize(); }
6666

6767

68-
#elif defined(__FreeBSD__)
68+
#elif defined(__FreeBSD__) || defined(__NetBSD__)
6969
static inline uint64_t memUsed(void) {
7070
struct rusage ru;
7171
getrusage(RUSAGE_SELF, &ru);

MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/fmemopen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// limitations under the License.
1616
//
1717

18-
#ifndef __linux__
18+
#if !defined(__linux__) && !defined(__NetBSD__)
1919

2020
#include <stdio.h>
2121
#include <stdlib.h>
@@ -111,4 +111,3 @@ FILE *fmemopen(void *buf, size_t size, const char *mode) {
111111
}
112112

113113
#endif // __linux__
114-

MultiSource/Benchmarks/MiBench/office-ispell/term.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static char Rcs_Id[] =
7272
#include "msgs.h"
7373
#include <signal.h>
7474

75-
#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__APPLE__)
75+
#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
7676
/* Use termios under at least glibc */
7777
#include <termios.h>
7878
#define USE_TERMIOS

MultiSource/Benchmarks/Olden/voronoi/newvor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ QUAD_EDGE next_edge, avail_edge;
165165

166166
void delete_all_edges() { next_edge= 0; avail_edge = NYL;}
167167

168-
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__MINGW32__)
168+
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__MINGW32__)
169169
#define MEMALIGN_IS_NOT_AVAILABLE
170170
#endif
171171

SingleSource/Benchmarks/Misc/oourafft.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <memory.h>
33
#include <stdio.h>
44
#include <stdlib.h>
5-
#if !defined(__APPLE__) && !defined(__FreeBSD__) // memalign
5+
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) // memalign
66
#include <malloc.h>
77
#endif
88

@@ -37,7 +37,7 @@ int main()
3737
t_overhead = t_end - t_start;
3838

3939
/* Prepare aux data */
40-
#if !defined(__APPLE__) && !defined(__FreeBSD__) /* Darwin always 16-byte aligns malloc data */
40+
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) /* Darwin always 16-byte aligns malloc data */
4141
ip = memalign(16, sqrt(N)*sizeof(int));
4242
w = memalign(16, 2*N*5/4*sizeof(double));
4343
#else
@@ -47,7 +47,7 @@ int main()
4747
makewt(N >> 1, ip, w);
4848

4949
/* Allocate buffers */
50-
#if !defined(__APPLE__) && !defined(__FreeBSD__) /* Darwin always 16-byte aligns malloc data */
50+
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) /* Darwin always 16-byte aligns malloc data */
5151
ref = memalign(16, 2*N*sizeof(double));
5252
cmp = memalign(16, 2*N*sizeof(double));
5353
src = memalign(16, 2*N*sizeof(double));
@@ -757,4 +757,3 @@ void cftmdl(int n, int l, double *a, double *w)
757757
}
758758
}
759759
}
760-

SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* http://www.hackersdelight.org/HDcode/nlz.cc and
33
* http://www.hackersdelight.org/HDcode/ntz.cc
44
*/
5+
#if defined(__NetBSD__)
6+
#include <sys/bitops.h>
7+
#endif
58
#include <stdio.h>
69
#include <string.h>
710
#include <strings.h>
@@ -72,6 +75,10 @@ int ntz8(unsigned x) {
7275
#define ffsl ffs
7376
#endif
7477

78+
#if defined(__NetBSD__)
79+
#define ffsl ffs64
80+
#endif
81+
7582
int i;
7683
int main(void) {
7784
long long l;
@@ -107,4 +114,3 @@ int main(void) {
107114

108115
return(0);
109116
}
110-

SingleSource/UnitTests/2007-04-25-weak.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
2+
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
33
extern int test_weak () __attribute__ ((weak_import));
44
#else
55
extern int test_weak () __attribute__ ((weak));

0 commit comments

Comments
 (0)