[Rd] latest beta + MinGW 3.1.0-1 = minor fix needed

Simon Urbanek simon.urbanek at math.uni-augsburg.de
Fri Oct 3 19:08:15 MEST 2003

MinGW 3.1.0-1 is currently the latest official MinGW release, therefore 
I tried to compile the latest R beta (rsync today). There is one minor 
problem when trying that:

gcc  -O2 -Wall -pedantic -I../../include -I../../gnuwin32 
-DHAVE_CONFIG_H  -c internet.c -o internet.o
In file included from internet.c:880:
sock.h:23: conflicting types for `ssize_t'
n:/MinGW/include/sys/types.h:119: previous declaration of `ssize_t'
make[3]: *** [internet.o] Error 1

(This is in src/modules/internet)

Obviously ssize_t was added to the system types in MinGW. The 
corresponding files:

MinGW: sys/types.h:

#ifndef _SSIZE_T_
#define _SSIZE_T_
typedef long _ssize_t;

R: src/modules/internet/sock.h

#ifdef Win32
typedef int ssize_t;

There are two possible fixes for this:
1) make sock.h use long instead of int.
2) use something like:
#if defined Win32 && !defined _SSIZE_T_

I don't think either fix is "better" in any way, but personally I'd go 
for the "long" (for Win32 I don't see any difference, but for Win64 fix 
2) may be less safe?).

MinGW 3.1.0-1
w32api 2.4


More information about the R-devel mailing list