Skip to content

Commit 9c620c0

Browse files
committed
Use binary mode for the testsuite. Needed for mingw build.
1 parent 12d862d commit 9c620c0

File tree

7 files changed

+42
-9
lines changed

7 files changed

+42
-9
lines changed

ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2004-01-23 Bruno Haible <bruno@clisp.org>
2+
3+
* tests/table-from.c: Include binary-io.h.
4+
(main): Switch stdout to binary mode.
5+
* tests/table-to.c: Include binary-io.h.
6+
(main): Switch stdout to binary mode.
7+
* tests/genutf8.c: Include binary-io.h.
8+
(main): Switch stdout to binary mode.
9+
* tests/Makefile.in (INCLUDES): Also look in srclib.
10+
(check): Pass INCLUDES when compiling genutf8.c.
11+
* tests/Makefile.os2 (INCLUDES): Also look in srclib.
12+
(genutf8.exe): Pass INCLUDES when compiling genutf8.c.
13+
* tests/Makefile.msvc (INCLUDES): Also look in srclib.
14+
(check): Pass INCLUDES when compiling genutf8.c.
15+
116
2004-01-21 Bruno Haible <bruno@clisp.org>
217

318
* src/iconv.c (force_binary): Remove variable.

tests/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CC = @CC@
1010
CFLAGS = @CFLAGS@
1111
CPPFLAGS = @CPPFLAGS@
1212
LDFLAGS = @LDFLAGS@
13-
INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include -I../lib
13+
INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include -I../srclib -I$(srcdir)/../srclib -I../lib
1414
LIBTOOL = @LIBTOOL@
1515
LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile
1616
LIBTOOL_LINK = $(LIBTOOL) --mode=link
@@ -31,7 +31,7 @@ all :
3131
check : all table-from table-to ../src/iconv_no_i18n
3232
$(srcdir)/check-stateless $(srcdir) ASCII
3333
# /* General multi-byte encodings */
34-
$(CC) $(LDFLAGS) $(CFLAGS) $(CPPFLAGS) $(srcdir)/genutf8.c -o genutf8 && \
34+
$(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(srcdir)/genutf8.c -o genutf8 && \
3535
./genutf8 > UTF-8.TXT && \
3636
$(srcdir)/check-stateless . UTF-8 && \
3737
$(RM) genutf8 UTF-8.TXT

tests/Makefile.msvc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ srcdir = .
3939
# Programs used by "make":
4040
CC = cl
4141
CFLAGS = $(MFLAGS) -W1 $(OPTIMFLAGS)
42-
INCLUDES = -I. -I..\include -I..\lib
42+
INCLUDES = -I. -I..\include -I..\srclib -I..\lib
4343
RM = -del
4444

4545
#### End of system configuration section. ####
@@ -57,7 +57,7 @@ uninstall :
5757
check : all table-from.exe table-to.exe ../src/iconv.exe uniq-u.exe
5858
$(srcdir)\check-stateless.bat $(srcdir) ASCII
5959
# /* General multi-byte encodings */
60-
$(CC) $(CFLAGS) $(srcdir)\genutf8.c -Fegenutf8.exe
60+
$(CC) $(INCLUDES) $(CFLAGS) $(srcdir)\genutf8.c -Fegenutf8.exe
6161
$(RM) genutf8.obj
6262
.\genutf8 > UTF-8.TXT
6363
$(srcdir)\check-stateless.bat . UTF-8

tests/Makefile.os2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Programs used by "make":
1010
CC = gcc
1111
CFLAGS = -O2 -Zmtd
12-
INCLUDES = -I. -I../include -I../lib
12+
INCLUDES = -I. -I../include -I../srclib -I../lib
1313

1414
#### End of system configuration section. ####
1515

@@ -136,7 +136,7 @@ table-to.exe : table-to.c
136136
copy ..\lib\iconv.dll iconv.dll
137137

138138
genutf8.exe : genutf8.c
139-
$(CC) $(CFLAGS) genutf8.c
139+
$(CC) $(INCLUDES) $(CFLAGS) genutf8.c
140140

141141
mostlyclean : clean
142142

tests/genutf8.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2000 Free Software Foundation, Inc.
1+
/* Copyright (C) 2000, 2004 Free Software Foundation, Inc.
22
This file is part of the GNU LIBICONV Library.
33
44
The GNU LIBICONV Library is free software; you can redistribute it
@@ -21,10 +21,16 @@
2121
#include <stdio.h>
2222
#include <stdlib.h>
2323

24+
#include "binary-io.h"
25+
2426
int main ()
2527
{
2628
int i1, i2, i3;
2729

30+
#if O_BINARY
31+
SET_BINARY(fileno(stdout));
32+
#endif
33+
2834
/* Range 0x0000..0x007f */
2935
for (i1 = 0; i1 < 0x80; i1++)
3036
printf("0x%02X\t0x%04X\n", i1, i1);

tests/table-from.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2000-2002 Free Software Foundation, Inc.
1+
/* Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
22
This file is part of the GNU LIBICONV Library.
33
44
The GNU LIBICONV Library is free software; you can redistribute it
@@ -27,6 +27,8 @@
2727
#include <iconv.h>
2828
#include <errno.h>
2929

30+
#include "binary-io.h"
31+
3032
/* If nonzero, ignore conversions outside Unicode plane 0. */
3133
static int bmp_only;
3234

@@ -106,6 +108,10 @@ int main (int argc, char* argv[])
106108
}
107109
charset = argv[1];
108110

111+
#if O_BINARY
112+
SET_BINARY(fileno(stdout));
113+
#endif
114+
109115
cd = iconv_open("UCS-4-INTERNAL",charset);
110116
if (cd == (iconv_t)(-1)) {
111117
perror("iconv_open");

tests/table-to.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2000-2002 Free Software Foundation, Inc.
1+
/* Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
22
This file is part of the GNU LIBICONV Library.
33
44
The GNU LIBICONV Library is free software; you can redistribute it
@@ -27,6 +27,8 @@
2727
#include <iconv.h>
2828
#include <errno.h>
2929

30+
#include "binary-io.h"
31+
3032
int main (int argc, char* argv[])
3133
{
3234
const char* charset;
@@ -39,6 +41,10 @@ int main (int argc, char* argv[])
3941
}
4042
charset = argv[1];
4143

44+
#if O_BINARY
45+
SET_BINARY(fileno(stdout));
46+
#endif
47+
4248
cd = iconv_open(charset,"UCS-4-INTERNAL");
4349
if (cd == (iconv_t)(-1)) {
4450
perror("iconv_open");

0 commit comments

Comments
 (0)