php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65599 Fix compiling for VC11 x64
Submitted: 2013-08-31 16:08 UTC Modified: 2013-09-05 23:44 UTC
From: phpdev at ehrhardt dot nl Assigned: aharvey (profile)
Status: Closed Package: radius (PECL)
PHP Version: 5.5.3 OS: Windows (x64)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpdev at ehrhardt dot nl
New email:
PHP Version: OS:

 

 [2013-08-31 16:08 UTC] phpdev at ehrhardt dot nl
Description:
------------
php_radius.dll compiles fine for PHP 5.5 VC11 x86. However, under VC11 x64 it fails with

error C2371: 'SSIZE_T': redefinition; different basic types

You can fix this by surrounding 'typedef long ssize_t;' with a ifndef, like this

#ifndef ssize_t
typedef long ssize_t;
#endif

I did not test if it works, but you can find compiled x64 versions here (as soon as I have updated all my builds):
http://www.apachelounge.com/viewtopic.php?t=5530

Jan Ehrhardt


Test script:
---------------
N/A

Expected result:
----------------
A VC11 x64 php_radius.dll

Actual result:
--------------
Compiling fails

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-05 21:05 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2013-09-05 21:05 UTC] aharvey@php.net
I'm leery of this because it's going to fail if ssize_t is a mere typedef and not 
#define'd, and I don't think there's any spec that says it has to be visible to 
the preprocessor.

Let me see if I can figure out enough of config.w32 to come up with a more robust 
test.
 [2013-09-05 23:31 UTC] phpdev at ehrhardt dot nl
I also looked a little bit further. As far as I can see ssize_t is always defined when compiling PHP for windows. See line 137 of
https://github.com/php/php-src/blob/master/win32/build/config.w32.h.in#L137

As soon as you configure PHP, this line gets copied to main/config.w32.h and will be included.

https://www.google.com/search?q=%22%23define+ssize_t+SSIZE_T%22 shows there have been more people struggling with this.

You could probably leave the line out or use
#define ssize_t SSIZE_T

I compiled php_radius.dll under X64 and X86 with this line without any problems.
 [2013-09-05 23:44 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2013-09-05 23:44 UTC] aharvey@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Yeah, I was looking at this concurrently and came to the same conclusion — that 
#define has been in PHP since 4.3, so I think we're good to just drop the typedef 
completely at this point.

Thanks for looking into this further!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 19:01:31 2024 UTC