public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin 64bits gcc produces erroneous constants with the win32 headers.
@ 2016-04-15 19:05 Nicolas Noble
  2016-04-15 19:24 ` Corinna Vinschen
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Noble @ 2016-04-15 19:05 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2293 bytes --]

I originally entered a bug on msys2's bug tracker, but it turns out
they only repackage cygwin packages, and I have verified this is an
issue on cygwin too, so I am now sending that report here.

Original entry:

https://github.com/Alexpux/MSYS2-packages/issues/555



Basically, the 64 bits "gcc-core" and "w32api-headers" cygwin packages
aren't really compatible with each others. As far as I understand,
this isn't an issue already documented here:
https://cygwin.com/faq-nochunks.html#faq.programming.win32-api
.

The 64 bits gcc that gets compiled in has sizeof(long) == 8. This
causes various troubles with the win32 api headers. These troubles
don't exist with the mingw64 compiler which has sizeof(long) == 4.

Here's an example of what I'm talking about. In the winsock API, the
FIONBIO ioctl command constant is computed using sizeof(u_long) (the
relevance of such method isn't discussed here). Using Visual Studio,
or mingw64's gcc, the value of FIONBIO is always 0x8004667e. But using
cygwin's gcc, when producing a 64 bits binary, the value of that
constant becomes 0x8008667e, which is an invalid ioctl command.

Either cygwin's gcc should have sizeof(long) == 4, or the
w32api-headers package should be fixed to replace long references with
something that is 32 bits in the locations that are relevant, such as
the computation of such constants. For that specific problem for
instance, all the lines such as

#define FIONBIO _IOW('f',126,u_long)

should become something like

#define FIONBIO _IOW('f',126,uint32_t)

I have attached a sample code, and its output when compiled using
cygwin 64 bits. The same code compiled with mingw gcc or Visual Studio
will always produces proper results all the time.

Here's the output in cygwin:

nnoble@NNOBLE0-W ~
$ gcc -o test-code test-code.c -lws2_32
nnoble@NNOBLE0-W ~
$ file test-code.exe
test-code.exe: PE32+ executable (console) x86-64, for MS Windows
nnoble@NNOBLE0-W ~
$ ./test-code.exe
Calling WSAIoctl with FIONBIO = 8008667e - sizeof(param1) = 8
WSAIoctl failed with error: -1
Calling WSAIoctl with FIONBIO = 8008667e - sizeof(param2) = 4
WSAIoctl failed with error: -1
Calling WSAIoctl with FIONBIO_PROPER = 8004667e - sizeof(param1) = 8
Success.
Calling WSAIoctl with FIONBIO_PROPER = 8004667e - sizeof(param2) = 4
Success.

[-- Attachment #2: cygcheck.out --]
[-- Type: application/octet-stream, Size: 22721 bytes --]


Cygwin Configuration Diagnostics
Current System Time: Fri Apr 15 19:11:48 2016

Windows 7 Enterprise Ver 6.1 Build 7601 Service Pack 1

Path:	C:\cygwin64\usr\local\bin
	C:\cygwin64\bin
	C:\Windows\CCM
	C:\ProgramData\Oracle\Java\javapath
	C:\Windows\system32
	C:\Windows
	C:\Windows\System32\Wbem
	C:\Windows\System32\WindowsPowerShell\v1.0
	C:\Windows\System32\WindowsPowerShell\v1.0
	C:\windows\corpam
	C:\Program Files (x86)\Google\Cert Installer
	C:\Windows\mrmagoo
	C:\python_27_amd64\files
	C:\Windows\ccmsetup
	C:\Program Files\Microsoft SQL Server\110\Tools\Binn
	C:\Program Files (x86)\Bit9\Parity Agent
	C:\gnubby\bin
	C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0
	C:\Program Files\Microsoft SQL Server\120\Tools\Binn
	C:\windows\corpam
	C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin
	C:\windows\corpam
	C:\Strawberry\c\bin
	C:\Strawberry\perl\site\bin
	C:\Strawberry\perl\bin
	C:\Program Files\TortoiseGit\bin
	C:\Go\bin
	C:\Program Files (x86)\Google\gWindows-Updater
	C:\Program Files\Puppet Labs\Puppet\bin
	%USERPROFILE%\.dnx\bin
	C:\Program Files\Microsoft DNX\Dnvm
	C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit
	C:\Program Files (x86)\nodejs
	C:\Ruby22-x64\bin
	C:\Users\nnoble\AppData\Local\Code\bin
	C:\Users\nnoble\AppData\Roaming\npm

Output from C:\cygwin64\bin\id.exe
UID: 1755154(nnoble)
GID: 1049089(Domain Users)
1049089(Domain Users)
197610(NNOBLE0-W+login_users)
559(Performance Log Users)
555(Remote Desktop Users)
545(Users)
4(INTERACTIVE)
66049(CONSOLE LOGON)
11(Authenticated Users)
15(This Organization)
4095(CurrentSession)
66048(LOCAL)
1670188(cloud-incentives-dashboard)
1477847(gt-printers-access)
1072945(eng)
1590177(windows-client-experiments-10)
1590178(windows-client-experiments-users-10)
1435853(nonconf)
1192219(google)
1228859(wirelessusers)
1500315(disable-autoenroll)
1640013(urs-team)
70145(Authentication authority asserted identity)
401408(Medium Mandatory Level)

SysDir: C:\Windows\system32
WinDir: C:\Windows

USER = 'nnoble'
PWD = '/home/nnoble'
HOME = '/home/nnoble'

HOMEPATH = '\Users\nnoble'
APPDATA = 'C:\Users\nnoble\AppData\Roaming'
SSH_AGENT_PID = '3036'
ProgramW6432 = 'C:\Program Files'
HOSTNAME = 'NNOBLE0-W'
SHELL = '/bin/bash'
TERM = 'xterm'
PROCESSOR_IDENTIFIER = 'Intel64 Family 6 Model 62 Stepping 4, GenuineIntel'
PROFILEREAD = 'true'
WINDIR = 'C:\Windows'
TVT = 'C:\Program Files (x86)\Lenovo'
PUBLIC = 'C:\Users\Public'
OLDPWD = '/usr/include/w32api'
ORIGINAL_PATH = '/cygdrive/c/Windows/CCM:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/windows/corpam:/cygdrive/c/Program Files (x86)/Google/Cert Installer:/cygdrive/c/Windows/mrmagoo:/cygdrive/c/python_27_amd64/files:/cygdrive/c/Windows/ccmsetup:/cygdrive/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/cygdrive/c/Program Files (x86)/Bit9/Parity Agent:/cygdrive/c/gnubby/bin:/cygdrive/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/cygdrive/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/cygdrive/c/windows/corpam:/cygdrive/c/Program Files/Google/Cloud SDK/google-cloud-sdk/bin:/cygdrive/c/windows/corpam:/cygdrive/c/Strawberry/c/bin:/cygdrive/c/Strawberry/perl/site/bin:/cygdrive/c/Strawberry/perl/bin:/cygdrive/c/Program Files/TortoiseGit/bin:/cygdrive/c/Go/bin:/cygdrive/c/Program Files (x86)/Google/gWindows-Updater:/cygdrive/c/Program Files/Puppet Labs/Puppet/bin:%USERPROFILE%/.dnx/bin:/cygdrive/c/Program Files/Microsoft DNX/Dnvm:/cygdrive/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/cygdrive/c/Program Files (x86)/nodejs:/cygdrive/c/Ruby22-x64/bin:/cygdrive/c/Users/nnoble/AppData/Local/Code/bin:/cygdrive/c/Users/nnoble/AppData/Roaming/npm'
USERDOMAIN = 'GOOGLE'
CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files'
UATDATA = 'C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77'
OS = 'Windows_NT'
ALLUSERSPROFILE = 'C:\ProgramData'
windows_tracing_flags = '3'
windows_tracing_logfile = 'C:\BVTBin\Tests\installpackage\csilogfile.log'
!:: = '::\'
TEMP = '/tmp'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
SSH_AUTH_SOCK = '/tmp/ssh-EwNZyrWBxU66/agent.2932'
USERNAME = 'nnoble'
VSSDK140Install = 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\'
PROCESSOR_LEVEL = '6'
ProgramFiles(x86) = 'C:\Program Files (x86)'
PSModulePath = 'C:\Program Files (x86)\Outercurve Foundation\Modules\;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;c:\Program Files\Microsoft Security Client\MpProvider\;C:\ProgramData\GoogleInternal\lib'
FP_NO_HOST_CHECK = 'NO'
SYSTEMDRIVE = 'C:'
LANG = 'en_US.UTF-8'
VS120COMNTOOLS = 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\'
USERPROFILE = 'C:\Users\nnoble'
FACTER_environment = 'stable'
TZ = 'America/Los_Angeles'
GNUBBY_PROMPT = '/usr/bin/GnubbyPrompt2.exe'
PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
LOGONSERVER = '\\CBF-DC-4'
CommonProgramW6432 = 'C:\Program Files\Common Files'
PROCESSOR_ARCHITECTURE = 'AMD64'
LOCALAPPDATA = 'C:\Users\nnoble\AppData\Local'
SSH_ASKPASS = '/usr/bin/GnubbyAskPass3.exe'
ProgramData = 'C:\ProgramData'
EXECIGNORE = '*.dll'
SHLVL = '1'
USERDNSDOMAIN = 'AD.CORP.GOOGLE.COM'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
GOROOT = 'C:\Go\'
OPENSSL_CONF = 'C:\OpenSSL-Win32\bin\openssl.cfg'
HOMEDRIVE = 'C:'
VBOX_MSI_INSTALL_PATH = 'C:\Program Files\Oracle\VirtualBox\'
COMSPEC = 'C:\Windows\system32\cmd.exe'
TMP = '/tmp'
SYSTEMROOT = 'C:\Windows'
PRINTER = 'Microsoft XPS Document Writer'
PROCESSOR_REVISION = '3e04'
VS100COMNTOOLS = 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info'
PROGRAMFILES = 'C:\Program Files'
VS140COMNTOOLS = 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\'
DISPLAY = ':0'
VS110COMNTOOLS = 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\'
NUMBER_OF_PROCESSORS = '12'
SESSIONNAME = 'Console'
COMPUTERNAME = 'NNOBLE0-W'
_ = '/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygwin
HKEY_CURRENT_USER\Software\Cygwin\Installations
  (default) = '\??\C:\gnubby'
  e022582115c10879 = '\??\C:\cygwin64'
HKEY_CURRENT_USER\Software\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
  (default) = '\??\c:\gnubby'
  e022582115c10879 = '\??\C:\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
  (default) = 'C:\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygwin\Installations
  (default) = '\??\c:\gnubby'

obcaseinsensitive set to 1

Cygwin installations found in the registry:
  System: Key: 0688816c26d0ce1b Path: c:\gnubby
  System: Key: e022582115c10879 Path: C:\cygwin64
  User:   Key: 0688816c26d0ce1b Path: C:\gnubby
  User:   Key: e022582115c10879 Path: C:\cygwin64

c:  hd  NTFS    953516Mb  34% CP CS UN PA FC     

C:\cygwin64      /          system  binary,auto
C:\cygwin64\bin  /usr/bin   system  binary,auto
C:\cygwin64\lib  /usr/lib   system  binary,auto
cygdrive prefix  /cygdrive  user    binary,posix=0,auto

Found: C:\cygwin64\bin\awk
 -> C:\cygwin64\bin\gawk.exe
Found: C:\cygwin64\bin\bash.exe
Found: C:\cygwin64\bin\cat.exe
Found: C:\cygwin64\bin\cp.exe
Found: C:\cygwin64\bin\cpp.exe
Not Found: crontab
Found: C:\cygwin64\bin\find.exe
Found: C:\Windows\system32\find.exe
Warning: C:\cygwin64\bin\find.exe hides C:\Windows\system32\find.exe
Found: C:\cygwin64\bin\gcc.exe
Not Found: gdb
Found: C:\cygwin64\bin\grep.exe
Found: C:\cygwin64\bin\kill.exe
Found: C:\cygwin64\bin\ld.exe
Found: C:\cygwin64\bin\ls.exe
Not Found: make
Found: C:\cygwin64\bin\mv.exe
Not Found: patch
Not Found: perl
Found: C:\cygwin64\bin\rm.exe
Found: C:\cygwin64\bin\sed.exe
Found: C:\gnubby\bin\ssh.exe
Found: C:\cygwin64\bin\sh.exe
Found: C:\gnubby\bin\sh.exe
Warning: C:\cygwin64\bin\sh.exe hides C:\gnubby\bin\sh.exe
Found: C:\cygwin64\bin\tar.exe
Found: C:\cygwin64\bin\test.exe
Found: C:\cygwin64\bin\vi.exe
Not Found: vim

   38k 2013/07/19 C:\cygwin64\bin\cygargp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygargp-0.dll" v0.0 ts=2013-07-19 15:07
   88k 2016/02/27 C:\cygwin64\bin\cygatomic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygatomic-1.dll" v0.0 ts=2016-02-27 06:50
   16k 2013/03/26 C:\cygwin64\bin\cygattr-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygattr-1.dll" v0.0 ts=2013-03-26 18:26
  180k 2015/03/23 C:\cygwin64\bin\cygblkid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygblkid-1.dll" v0.0 ts=2015-03-23 09:46
   64k 2013/03/07 C:\cygwin64\bin\cygbz2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygbz2-1.dll" v0.0 ts=2013-03-07 02:54
  117k 2013/05/05 C:\cygwin64\bin\cygcloog-isl-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygcloog-isl-4.dll" v0.0 ts=2013-05-05 16:41
 2231k 2016/03/08 C:\cygwin64\bin\cygcrypto-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypto-1.0.0.dll" v0.0 ts=2016-03-08 09:41
   27k 2015/11/17 C:\cygwin64\bin\cygffi-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygffi-6.dll" v0.0 ts=2015-11-17 22:14
   55k 2016/03/06 C:\cygwin64\bin\cygformw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygformw-10.dll" v0.0 ts=2016-03-06 19:27
   70k 2016/02/27 C:\cygwin64\bin\cyggcc_s-seh-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2016-02-27 05:48
   40k 2014/05/27 C:\cygwin64\bin\cyggdbm-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm-4.dll" v0.0 ts=1970-01-01 00:00
   13k 2014/05/27 C:\cygwin64\bin\cyggdbm_compat-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm_compat-4.dll" v0.0 ts=1970-01-01 00:00
  528k 2015/12/06 C:\cygwin64\bin\cyggmp-10.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmp-10.dll" v0.0 ts=2015-12-06 08:37
  105k 2016/02/27 C:\cygwin64\bin\cyggomp-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-1.dll" v0.0 ts=2016-02-27 05:53
   10k 2016/02/27 C:\cygwin64\bin\cyggomp-plugin-host_nonshm-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-plugin-host_nonshm-1.dll" v0.0 ts=2016-02-27 05:54
   30k 2015/01/27 C:\cygwin64\bin\cyghistory7.dll - os=4.0 img=0.0 sys=5.2
                  "cyghistory7.dll" v0.0 ts=2015-01-27 03:51
 1009k 2015/02/20 C:\cygwin64\bin\cygiconv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygiconv-2.dll" v0.0 ts=2015-02-20 17:07
   40k 2015/09/20 C:\cygwin64\bin\cygintl-8.dll - os=4.0 img=0.0 sys=5.2
                  "cygintl-8.dll" v0.0 ts=2015-09-20 19:10
  888k 2013/05/05 C:\cygwin64\bin\cygisl-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygisl-10.dll" v0.0 ts=2013-05-05 16:36
 1039k 2015/09/20 C:\cygwin64\bin\cygisl-13.dll - os=4.0 img=0.0 sys=5.2
                  "cygisl-13.dll" v0.0 ts=2015-09-20 12:39
    6k 2016/04/11 C:\cygwin64\bin\cyglsa64.dll - os=4.0 img=0.0 sys=5.2
                  "cyglsa64.dll" v0.0 ts=2016-04-11 08:57
  139k 2015/11/09 C:\cygwin64\bin\cyglzma-5.dll - os=4.0 img=0.0 sys=5.2
                  "cyglzma-5.dll" v0.0 ts=2015-11-09 06:12
  114k 2016/01/11 C:\cygwin64\bin\cygmagic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygmagic-1.dll" v0.0 ts=2016-01-11 22:19
  168k 2015/10/09 C:\cygwin64\bin\cygman-2-7-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygman-2-7-4.dll" v0.0 ts=2015-10-09 03:12
   22k 2015/10/09 C:\cygwin64\bin\cygmandb-2-7-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygmandb-2-7-4.dll" v0.0 ts=2015-10-09 03:18
   29k 2016/03/06 C:\cygwin64\bin\cygmenuw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygmenuw-10.dll" v0.0 ts=2016-03-06 19:27
   89k 2015/03/01 C:\cygwin64\bin\cygmpc-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpc-3.dll" v0.0 ts=2015-03-01 20:24
  345k 2016/03/06 C:\cygwin64\bin\cygmpfr-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpfr-4.dll" v0.0 ts=2016-03-06 16:29
   53k 2016/03/06 C:\cygwin64\bin\cygncurses++w-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncurses++w-10.dll" v0.0 ts=2016-03-06 19:31
  279k 2016/03/06 C:\cygwin64\bin\cygncursesw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncursesw-10.dll" v0.0 ts=2016-03-06 19:26
  319k 2015/06/01 C:\cygwin64\bin\cygp11-kit-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygp11-kit-0.dll" v0.0 ts=2015-06-01 19:02
   14k 2016/03/06 C:\cygwin64\bin\cygpanelw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygpanelw-10.dll" v0.0 ts=2016-03-06 19:27
  465k 2016/03/30 C:\cygwin64\bin\cygpcre-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpcre-1.dll" v0.0 ts=2016-03-30 22:00
   39k 2015/04/09 C:\cygwin64\bin\cygpipeline-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpipeline-1.dll" v0.0 ts=2015-04-09 21:04
   41k 2013/10/21 C:\cygwin64\bin\cygpopt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpopt-0.dll" v0.0 ts=2013-10-21 21:52
  308k 2016/02/27 C:\cygwin64\bin\cygquadmath-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygquadmath-0.dll" v0.0 ts=2016-02-27 06:53
  207k 2015/01/27 C:\cygwin64\bin\cygreadline7.dll - os=4.0 img=0.0 sys=5.2
                  "cygreadline7.dll" v0.0 ts=2015-01-27 03:51
   89k 2015/03/23 C:\cygwin64\bin\cygsmartcols-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygsmartcols-1.dll" v0.0 ts=2015-03-23 09:46
  424k 2016/03/08 C:\cygwin64\bin\cygssl-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssl-1.0.0.dll" v0.0 ts=2016-03-08 09:41
   12k 2016/02/27 C:\cygwin64\bin\cygssp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssp-0.dll" v0.0 ts=2016-02-27 06:45
 1339k 2016/02/27 C:\cygwin64\bin\cygstdc++-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygstdc++-6.dll" v0.0 ts=2016-02-27 06:11
   66k 2016/02/04 C:\cygwin64\bin\cygtasn1-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygtasn1-6.dll" v0.0 ts=2016-02-04 13:53
   53k 2016/03/06 C:\cygwin64\bin\cygticw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygticw-10.dll" v0.0 ts=2016-03-06 19:26
   15k 2015/03/23 C:\cygwin64\bin\cyguuid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyguuid-1.dll" v0.0 ts=2015-03-23 09:46
    8k 2016/02/27 C:\cygwin64\bin\cygvtv-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygvtv-0.dll" v0.0 ts=2016-02-27 06:45
    8k 2016/02/27 C:\cygwin64\bin\cygvtv_stubs-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygvtv_stubs-0.dll" v0.0 ts=2016-02-27 06:46
   80k 2014/11/19 C:\cygwin64\bin\cygz.dll - os=4.0 img=0.0 sys=5.2
                  "cygz.dll" v0.0 ts=2014-11-19 23:08
 3456k 2016/04/11 C:\cygwin64\bin\cygwin1.dll - os=4.0 img=0.0 sys=5.2
                  "cygwin1.dll" v0.0 ts=2016-04-11 08:58
    Cygwin DLL version info:
        DLL version: 2.5.0
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 297
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5

   13k 2016/01/26 C:\gnubby\bin\cygcom_err-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygcom_err-2.dll" v0.0 ts=2015-03-19 02:44
 2217k 2016/01/26 C:\gnubby\bin\cygcrypto-1.0.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypto-1.0.0.dll" v0.0 ts=2015-12-03 20:38
   69k 2016/01/26 C:\gnubby\bin\cyggcc_s-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2015-07-01 18:03
   69k 2016/01/26 C:\gnubby\bin\cyggcc_s-seh-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2015-07-01 18:03
  258k 2016/01/26 C:\gnubby\bin\cyggssapi_krb5-2.dll - os=4.0 img=0.0 sys=5.2
                  "cyggssapi_krb5-2.dll" v0.0 ts=2015-11-09 16:54
 1009k 2016/01/26 C:\gnubby\bin\cygiconv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygiconv-2.dll" v0.0 ts=2015-02-20 17:07
   40k 2016/01/26 C:\gnubby\bin\cygintl-8.dll - os=4.0 img=0.0 sys=5.2
                  "cygintl-8.dll" v0.0 ts=2015-09-20 19:10
  180k 2016/01/26 C:\gnubby\bin\cygk5crypto-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygk5crypto-3.dll" v0.0 ts=2015-11-09 16:53
  720k 2016/01/26 C:\gnubby\bin\cygkrb5-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygkrb5-3.dll" v0.0 ts=2015-11-09 16:53
   35k 2016/01/26 C:\gnubby\bin\cygkrb5support-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygkrb5support-0.dll" v0.0 ts=2015-11-09 16:53
  301k 2016/01/26 C:\gnubby\bin\cygncursesw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncursesw-10.dll" v0.0 ts=2015-10-20 16:59
   41k 2016/01/26 C:\gnubby\bin\cygpopt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpopt-0.dll" v0.0 ts=2013-10-21 21:52
  207k 2016/01/26 C:\gnubby\bin\cygreadline7.dll - os=4.0 img=0.0 sys=5.2
                  "cygreadline7.dll" v0.0 ts=2015-01-27 03:51
   12k 2016/01/26 C:\gnubby\bin\cygssp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssp-0.dll" v0.0 ts=2015-07-01 18:53
  940k 2016/01/26 C:\gnubby\bin\cygstdc++-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygstdc++-6.dll" v0.0 ts=2015-07-01 18:17
  124k 2016/01/26 C:\gnubby\bin\cygusb-1.0.dll - os=4.0 img=0.0 sys=5.2
                  "cygusb-1.0.dll" v0.0 ts=2015-11-04 20:09
   80k 2016/01/26 C:\gnubby\bin\cygz.dll - os=4.0 img=0.0 sys=5.2
                  "cygz.dll" v0.0 ts=2014-11-19 23:08
 3312k 2016/01/26 C:\gnubby\bin\cygwin1.dll - os=4.0 img=0.0 sys=5.2
                  "cygwin1.dll" v0.0 ts=2015-11-14 11:44
    Cygwin DLL version info:
        DLL version: 2.3.1
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 291
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5

Warning: There are multiple cygwin1.dlls on your path

Can't find the cygrunsrv utility, skipping services check.


Cygwin Package Information
Last downloaded files to: C:\Users\nnoble\Downloads
Last downloaded files from: http://cygwin.mirror.constant.com/

Package                  Version            Status
_autorebase              001003-2           OK
alternatives             1.3.30c-10         OK
base-cygwin              3.8-1              OK
base-files               4.2-4              OK
bash                     4.3.42-4           OK
binutils                 2.25-4             OK
bzip2                    1.0.6-2            OK
ca-certificates          2.7-1              OK
coreutils                8.25-3             OK
cygutils                 1.4.15-2           OK
cygwin                   2.5.0-1            OK
cygwin-devel             2.5.0-1            OK
dash                     0.5.8-3            OK
editrights               1.03-1             OK
file                     5.25-1             OK
findutils                4.6.0-1            OK
gawk                     4.1.3-1            OK
gcc-core                 5.3.0-3            OK
getent                   2.18.90-4          OK
grep                     2.24-1             OK
groff                    1.22.3-1           OK
gzip                     1.7-1              OK
hostname                 3.13-1             OK
info                     6.1-2              OK
ipc-utils                1.0-2              OK
less                     481-1              OK
libargp                  20110921-2         OK
libatomic1               5.3.0-3            OK
libattr1                 2.4.46-1           OK
libblkid1                2.25.2-2           OK
libbz2_1                 1.0.6-2            OK
libcloog-isl4            0.18.0-2           OK
libffi6                  3.2.1-2            OK
libgcc1                  5.3.0-3            OK
libgdbm4                 1.11-1             OK
libgmp10                 6.1.0-3p1          OK
libgomp1                 5.3.0-3            OK
libiconv                 1.14-3             OK
libiconv2                1.14-3             OK
libintl8                 0.19.5.1-2         OK
libisl10                 0.11.1-2           OK
libisl13                 0.14.1-1           OK
liblzma5                 5.2.2-1            OK
libmpc3                  1.0.3-1            OK
libmpfr4                 3.1.4-1            OK
libncursesw10            6.0-4.20160305     OK
libopenssl100            1.0.2g-3           OK
libp11-kit0              0.22.1-1           OK
libpcre1                 8.38-3             OK
libpipeline1             1.4.0-1            OK
Empty package libpopt0
libpopt0                 1.16-1             OK
libquadmath0             5.3.0-3            OK
libreadline7             6.3.8-1            OK
libsmartcols1            2.25.2-2           OK
libssp0                  5.3.0-3            OK
libstdc++6               5.3.0-3            OK
libtasn1_6               4.7-1              OK
libuuid1                 2.25.2-2           OK
libvtv0                  5.3.0-3            OK
login                    1.11-1             OK
lynx                     2.8.7-2            OK
man-db                   2.7.4-1            OK
mintty                   2.3.5-0            OK
ncurses                  6.0-4.20160305     OK
openssl                  1.0.2g-3           OK
p11-kit                  0.22.1-1           OK
p11-kit-trust            0.22.1-1           OK
popt                     1.16-1             OK
rebase                   4.4.2-1            OK
run                      1.3.4-2            OK
sed                      4.2.2-3            OK
tar                      1.28-1             OK
terminfo                 6.0-4.20160305     OK
tzcode                   2016c-1            OK
util-linux               2.25.2-2           OK
vim-minimal              7.4.1558-1         OK
w32api-headers           4.0.2-1            OK
w32api-runtime           4.0.4-1            OK
which                    2.20-2             OK
windows-default-manifest 6.4-1              OK
xz                       5.2.2-1            OK
zlib0                    1.2.8-3            OK
Use -h to see help about each section

[-- Attachment #3: test-code.c --]
[-- Type: text/x-csrc, Size: 2338 bytes --]

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>

#define FIONBIO_PROPER 0x8004667e

int main(int argc, char **argv)  {
    WSADATA wsaData;
    SOCKET ConnectSocket = INVALID_SOCKET;
    int iResult;
    DWORD dResult;
    unsigned long param1 = 1;
    unsigned int param2 = 1;
    int iRet = 0;

    // Initialize Winsock
    iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
    if (iResult != 0) {
        printf("WSAStartup failed with error: %d\n", iResult);
        return 1;
    }

    ConnectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (ConnectSocket == INVALID_SOCKET) {
        printf("socket failed with error: %ld\n", WSAGetLastError());
        WSACleanup();
        return 1;
    }

    printf("Calling WSAIoctl with FIONBIO = %08x - sizeof(param1) = %d\n", FIONBIO, sizeof(param1));
    iResult = WSAIoctl(ConnectSocket, FIONBIO, &param1, sizeof(param1), NULL, 0, &dResult, NULL, NULL);
    if (iResult != 0) {
        printf("WSAIoctl failed with error: %d\n", iResult);
        iRet = 1;
    } else {
        printf("Success.\n");
    }

    printf("Calling WSAIoctl with FIONBIO = %08x - sizeof(param2) = %d\n", FIONBIO, sizeof(param2));
    iResult = WSAIoctl(ConnectSocket, FIONBIO, &param2, sizeof(param2), NULL, 0, &dResult, NULL, NULL);
    if (iResult != 0) {
        printf("WSAIoctl failed with error: %d\n", iResult);
        iRet = 1;
    } else {
        printf("Success.\n");
    }

    printf("Calling WSAIoctl with FIONBIO_PROPER = %08x - sizeof(param1) = %d\n", FIONBIO_PROPER, sizeof(param1));
    iResult = WSAIoctl(ConnectSocket, FIONBIO_PROPER, &param1, sizeof(param1), NULL, 0, &dResult, NULL, NULL);
    if (iResult != 0) {
        printf("WSAIoctl failed with error: %d\n", iResult);
        iRet = 1;
    } else {
        printf("Success.\n");
    }

    printf("Calling WSAIoctl with FIONBIO_PROPER = %08x - sizeof(param2) = %d\n", FIONBIO_PROPER, sizeof(param2));
    iResult = WSAIoctl(ConnectSocket, FIONBIO_PROPER, &param2, sizeof(param2), NULL, 0, &dResult, NULL, NULL);
    if (iResult != 0) {
        printf("WSAIoctl failed with error: %d\n", iResult);
        iRet = 1;
    } else {
        printf("Success.\n");
    }

    closesocket(ConnectSocket);
    WSACleanup();

    return iRet;
}

[-- Attachment #4: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 19:05 Cygwin 64bits gcc produces erroneous constants with the win32 headers Nicolas Noble
@ 2016-04-15 19:24 ` Corinna Vinschen
  2016-04-15 19:56   ` Nicolas Noble
  0 siblings, 1 reply; 9+ messages in thread
From: Corinna Vinschen @ 2016-04-15 19:24 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

On Apr 15 12:05, Nicolas Noble wrote:
> I originally entered a bug on msys2's bug tracker, but it turns out
> they only repackage cygwin packages, and I have verified this is an
> issue on cygwin too, so I am now sending that report here.
> 
> Original entry:
> 
> https://github.com/Alexpux/MSYS2-packages/issues/555
> 
> 
> 
> Basically, the 64 bits "gcc-core" and "w32api-headers" cygwin packages
> aren't really compatible with each others.

They are not supposed to.  You have to make sure to separate the
win32 and Cygwin headers carefully.

> As far as I understand,
> this isn't an issue already documented here:
> https://cygwin.com/faq-nochunks.html#faq.programming.win32-api

It's documented in https://cygwin.com/faq.html#faq.programming.64bitporting


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 19:24 ` Corinna Vinschen
@ 2016-04-15 19:56   ` Nicolas Noble
  2016-04-15 20:42     ` Corinna Vinschen
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Noble @ 2016-04-15 19:56 UTC (permalink / raw)
  To: cygwin

On Fri, Apr 15, 2016 at 12:23 PM, Corinna Vinschen
<corinna-cygwin@cygwin.com> wrote:
> On Apr 15 12:05, Nicolas Noble wrote:
>> I originally entered a bug on msys2's bug tracker, but it turns out
>> they only repackage cygwin packages, and I have verified this is an
>> issue on cygwin too, so I am now sending that report here.
>>
>> Original entry:
>>
>> https://github.com/Alexpux/MSYS2-packages/issues/555
>>
>>
>>
>> Basically, the 64 bits "gcc-core" and "w32api-headers" cygwin packages
>> aren't really compatible with each others.
>
> They are not supposed to.  You have to make sure to separate the
> win32 and Cygwin headers carefully.

I'm not sure I am getting that reply. The gcc-core package is only a
compiler, and I am talking about the "gcc" binary contained within.
The example I am showing is technically using only the w32api-headers,
trying to use the win32 api as described here:
https://cygwin.com/faq-nochunks.html#faq.programming.win32-api

>
>> As far as I understand,
>> this isn't an issue already documented here:
>> https://cygwin.com/faq-nochunks.html#faq.programming.win32-api
>
> It's documented in https://cygwin.com/faq.html#faq.programming.64bitporting

Right, but that isn't the same thing. I am well aware of the various
issues tied with sizeof(long), otherwise it would have taken me a lot
more time to understand what was going on here. I am talking about the
fact that the cygwin-provided w32api-headers package doesn't properly
work with the cygwin-provided 64 bits gcc. Unless I am mistaken
somewhere, this isn't an issue with the example code. This is an issue
when trying to compile a 64 bits binary that uses the win32 api,
nothing more.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 19:56   ` Nicolas Noble
@ 2016-04-15 20:42     ` Corinna Vinschen
  2016-04-15 20:47       ` Corinna Vinschen
  2016-04-15 20:54       ` Nicolas Noble
  0 siblings, 2 replies; 9+ messages in thread
From: Corinna Vinschen @ 2016-04-15 20:42 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 3225 bytes --]

On Apr 15 12:56, Nicolas Noble wrote:
> On Fri, Apr 15, 2016 at 12:23 PM, Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
> > On Apr 15 12:05, Nicolas Noble wrote:
> >> I originally entered a bug on msys2's bug tracker, but it turns out
> >> they only repackage cygwin packages, and I have verified this is an
> >> issue on cygwin too, so I am now sending that report here.
> >>
> >> Original entry:
> >>
> >> https://github.com/Alexpux/MSYS2-packages/issues/555
> >>
> >>
> >>
> >> Basically, the 64 bits "gcc-core" and "w32api-headers" cygwin packages
> >> aren't really compatible with each others.
> >
> > They are not supposed to.  You have to make sure to separate the
> > win32 and Cygwin headers carefully.
> 
> I'm not sure I am getting that reply. The gcc-core package is only a
> compiler, and I am talking about the "gcc" binary contained within.
> The example I am showing is technically using only the w32api-headers,
> trying to use the win32 api as described here:
> https://cygwin.com/faq-nochunks.html#faq.programming.win32-api
> 
> >
> >> As far as I understand,
> >> this isn't an issue already documented here:
> >> https://cygwin.com/faq-nochunks.html#faq.programming.win32-api
> >
> > It's documented in https://cygwin.com/faq.html#faq.programming.64bitporting
> 
> Right, but that isn't the same thing. I am well aware of the various
> issues tied with sizeof(long),

Sorry, I wasn't aware of this since you wrote something along the lines
of gcc should make sizeof(long) == 4 which just doesn't make sense in an
LP64 environment.

> otherwise it would have taken me a lot
> more time to understand what was going on here. I am talking about the
> fact that the cygwin-provided w32api-headers package doesn't properly
> work with the cygwin-provided 64 bits gcc. Unless I am mistaken
> somewhere, this isn't an issue with the example code. This is an issue
> when trying to compile a 64 bits binary that uses the win32 api,
> nothing more.

One problem is that you're not supposed to use WinSock or the winsock
headers when compiling Cygwin applications.  Use the Cygwin POSIX headers
and Cygwin socket functions instead.  If you use WinSock headers and/or
functions and it breaks, you got to keep the pieces.

The problem with the WInSock definition of FIONBIO (and probably others)
is a bug in the w32api-headers and thus might be most effectifely
handled upstream in the Mingw-w64 community.

You're basically right about the redefinition of FIONBIO, but u_long is
the type used by Microsoft and thus the Mingw-w64 project would probably
like to keep it that way for compatibility with their upstream :)

OTOH, u_long in an LP64 environment *must* have the same size as long,
thus 8 bytes.

However, Mingw-w64 already contains a lot of changes to accommodate
the Cygwin LP64 environment, and incidentally there's already a type
available which does the right thing, so it might be a good idea to
suggest using that:

#define FIONBIO _IOW('f',126,__ms_u_long)


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 20:42     ` Corinna Vinschen
@ 2016-04-15 20:47       ` Corinna Vinschen
  2016-04-15 20:54       ` Nicolas Noble
  1 sibling, 0 replies; 9+ messages in thread
From: Corinna Vinschen @ 2016-04-15 20:47 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]

On Apr 15 22:41, Corinna Vinschen wrote:
> On Apr 15 12:56, Nicolas Noble wrote:
> >  This is an issue
> > when trying to compile a 64 bits binary that uses the win32 api,
> > nothing more.
> 
> One problem is that you're not supposed to use WinSock or the winsock
> headers when compiling Cygwin applications.  Use the Cygwin POSIX headers
> and Cygwin socket functions instead.  If you use WinSock headers and/or
> functions and it breaks, you got to keep the pieces.

Btw., the preceeding paragraph is even more true after fixing Mingw-w64's
winsock headers because in this case values like FIONREAD, FIOASYNC,
etc (*) will *collide* when using WinSock and Cygwin headers due to their
different values.

So, again, to be very clear:  Never mix Cygwin's POSIX socket functions
and Cygwin's POSIX socket headers with Winsock headers and functions.
In theory only Cygwin should be a consumer of the Winsock headers and
functions in a Cygwin environment.


> The problem with the WInSock definition of FIONBIO (and probably others)
> is a bug in the w32api-headers and thus might be most effectifely
> handled upstream in the Mingw-w64 community.
> 
> You're basically right about the redefinition of FIONBIO, but u_long is
> the type used by Microsoft and thus the Mingw-w64 project would probably
> like to keep it that way for compatibility with their upstream :)
> 
> OTOH, u_long in an LP64 environment *must* have the same size as long,
> thus 8 bytes.
> 
> However, Mingw-w64 already contains a lot of changes to accommodate
> the Cygwin LP64 environment, and incidentally there's already a type
> available which does the right thing, so it might be a good idea to
> suggest using that:
> 
> #define FIONBIO _IOW('f',126,__ms_u_long)


Corinna

(*) FIONBIO is an exception beacuse its value in the Cygwin headers
    is hardcoded to 0x8004667e for historical reasons.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 20:42     ` Corinna Vinschen
  2016-04-15 20:47       ` Corinna Vinschen
@ 2016-04-15 20:54       ` Nicolas Noble
  2016-04-15 20:55         ` Nicolas Noble
  2016-04-15 21:13         ` Corinna Vinschen
  1 sibling, 2 replies; 9+ messages in thread
From: Nicolas Noble @ 2016-04-15 20:54 UTC (permalink / raw)
  To: cygwin

>> Right, but that isn't the same thing. I am well aware of the various
>> issues tied with sizeof(long),
>
> Sorry, I wasn't aware of this since you wrote something along the lines
> of gcc should make sizeof(long) == 4 which just doesn't make sense in an
> LP64 environment.

I can see how this was confusing, yes. I was trying to make the point that


> One problem is that you're not supposed to use WinSock or the winsock
> headers when compiling Cygwin applications.  Use the Cygwin POSIX headers
> and Cygwin socket functions instead.  If you use WinSock headers and/or
> functions and it breaks, you got to keep the pieces.

Okay. See, that's something I didn't see documented anywhere :-) The
documentation seems to say that it's fair game to use the Win32 API as
long as you're linking the libraries in, and no mention of what is and
isn't acceptable.

Note that I'm not talking about mixing up Cygwin sockets and WinSock
sockets. I'm simply talking about compiling a piece of code that is
100% WinSock aware, and exposes an API that doesn't even mention
sockets. Think, I don't know, libcurl in easy mode for instance. Or
maybe a "publish tweets on twitter" library. It should be acceptable
that said static code be fully independent, and usable with cygwin
code.

Of course, solutions might be to say "sorry, it doesn't actually
compile properly with Cygwin, please only use mingw-w64 to compile it,
then link the resulting static .a file with your project" or "sorry,
using Cygwin, you'll have to use the posix-version of the library,
thus having to lose some amount of performance due to the Cygwin
socket translation layer", but I find neither very appropriate. I'd
rather have the code be compatible with cygwin's compiler and
environment, while retaining the ability to fully use the WinSock API.


> However, Mingw-w64 already contains a lot of changes to accommodate
> the Cygwin LP64 environment, and incidentally there's already a type
> available which does the right thing, so it might be a good idea to
> suggest using that:
>
> #define FIONBIO _IOW('f',126,__ms_u_long)

So you're saying that the w32api-headers cygwin package actually comes
from mingw-w64 ? I can go and bug them instead then :-)

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 20:54       ` Nicolas Noble
@ 2016-04-15 20:55         ` Nicolas Noble
  2016-04-15 21:14           ` Corinna Vinschen
  2016-04-15 21:13         ` Corinna Vinschen
  1 sibling, 1 reply; 9+ messages in thread
From: Nicolas Noble @ 2016-04-15 20:55 UTC (permalink / raw)
  To: cygwin

> I can see how this was confusing, yes. I was trying to make the point that
Dang I fail with e-mails lately. The rest of the sentence is
"mingw64's compiler has sizeof(long) == 4".

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 20:54       ` Nicolas Noble
  2016-04-15 20:55         ` Nicolas Noble
@ 2016-04-15 21:13         ` Corinna Vinschen
  1 sibling, 0 replies; 9+ messages in thread
From: Corinna Vinschen @ 2016-04-15 21:13 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

On Apr 15 13:54, Nicolas Noble wrote:
> 
> > However, Mingw-w64 already contains a lot of changes to accommodate
> > the Cygwin LP64 environment, and incidentally there's already a type
> > available which does the right thing, so it might be a good idea to
> > suggest using that:
> >
> > #define FIONBIO _IOW('f',126,__ms_u_long)
> 
> So you're saying that the w32api-headers cygwin package actually comes
> from mingw-w64 ? I can go and bug them instead then :-)

Yes, together with w32api-runtime it's basically the subset of Windows
headers and libs, minus the CRT parts.  JonY, our Cygwin maintainer for
these two packages, is a mingw-w64 dev as well.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Cygwin 64bits gcc produces erroneous constants with the win32 headers.
  2016-04-15 20:55         ` Nicolas Noble
@ 2016-04-15 21:14           ` Corinna Vinschen
  0 siblings, 0 replies; 9+ messages in thread
From: Corinna Vinschen @ 2016-04-15 21:14 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

On Apr 15 13:55, Nicolas Noble wrote:
> > I can see how this was confusing, yes. I was trying to make the point that
> Dang I fail with e-mails lately. The rest of the sentence is
> "mingw64's compiler has sizeof(long) == 4".

Yes, sure.  Mingw's gcc targets Windows, Cygwin's gcc targets Cygwin
in the first place.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-15 21:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15 19:05 Cygwin 64bits gcc produces erroneous constants with the win32 headers Nicolas Noble
2016-04-15 19:24 ` Corinna Vinschen
2016-04-15 19:56   ` Nicolas Noble
2016-04-15 20:42     ` Corinna Vinschen
2016-04-15 20:47       ` Corinna Vinschen
2016-04-15 20:54       ` Nicolas Noble
2016-04-15 20:55         ` Nicolas Noble
2016-04-15 21:14           ` Corinna Vinschen
2016-04-15 21:13         ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).