You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I recently (tried) to test VS 2013 builds, but while vs2013 in theory supports mixed declarations and code, in practice that support is broken, and failed to build toke.obj:
The one case I looked at in detail, VS 2013 required an extra ; after a conditional statement to accept the following declaration, for example:
C:\Users\Tony\dev\perl\git>cl /c mixed.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
mixed.c
mixed.c(8) : error C2143: syntax error : missing ';' before 'const'
mixed.c(9) : error C2065: 'pend' : undeclared identifier
mixed.c(9) : error C2100: illegal indirection
C:\Users\Tony\dev\perl\git>type mixed.c
/* adapted from S_intuit_more() in toke.c.
don't run this code
*/
int g(const char *p) {
if (!p)
return (0);
const char * const pend = p+1;
return *pend;
}
regcomp.obj also failed to build due to the use of the "inline" keyword in regcomp.h. This is fairly trivially fixable but inline is also C99.
Despite these build issues we haven't received any error reports for VS2013, so I don't think it's worth re-working any mixed declarations to support it.
It might be worth updating regcomp.h to use PERL_STATIC_INLINE but that's out of scope for this commit.
I recently (tried) to test VS 2013 builds, but while vs2013 in theory
supports mixed declarations and code, in practice that support is
broken, and failed to build toke.obj:
The one case I looked at in detail, VS 2013 required an extra ; after
a conditional statement to accept the following declaration, for
example:
```
C:\Users\Tony\dev\perl\git>cl /c mixed.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
mixed.c
mixed.c(8) : error C2143: syntax error : missing ';' before 'const'
mixed.c(9) : error C2065: 'pend' : undeclared identifier
mixed.c(9) : error C2100: illegal indirection
C:\Users\Tony\dev\perl\git>type mixed.c
/* adapted from S_intuit_more() in toke.c.
don't run this code
*/
int g(const char *p) {
if (!p)
return (0);
const char * const pend = p+1;
return *pend;
}
```
regcomp.obj also failed to build due to the use of the "inline"
keyword in regcomp.h. This is fairly trivially fixable but
inline is also C99.
Despite these build issues we haven't received any error reports for
VS2013, so I don't think it's worth re-working any mixed declarations
to support it.
It might be worth updating regcomp.h to use PERL_STATIC_INLINE
but that's out of scope for this commit.
On 11/14/23 21:02, mauke wrote:
Not a lot of those around:
|cpan/Compress-Raw-Zlib/zlib-src/zutil.c:#if (!defined(_MSC_VER) ||
(_MSC_VER <= 600)) cpan/Compress-Raw-Zlib/zlib-src/zutil.h:#if
(defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
cpan/Time-Piece/Piece.xs:#if !(_MSC_VER >= 1500)
The two files above will require coordination with their upstream
maintainers.
We can remove more than just that from HiRes.xs.
That quoted line is part of a section that pertains solely to unsupported Visual Studio and unsupported mingw.org compilers.
AFAICS,, the following piece from HiRes.xs can (and should) be removed in its entirety:
/* Visual C++ 2013 and older don't have the timespec structure.
* Neither do mingw.org compilers with MinGW runtimes older than 3.22. */
# if((defined(_MSC_VER) && _MSC_VER < 1900) || \
(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) && \
defined(__MINGW32_MAJOR_VERSION) && (__MINGW32_MAJOR_VERSION < 3 || \
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 22))))
struct timespec {
time_t tv_sec;
long tv_nsec;
};
# endif
Also, now that MingW can be compiled with UCRT, things that are under WIN32 and #ifndef _MSC_VER should be checked to see if _UCRT is defined, and then we can assume a modern run time library, but I don't know how modern
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently (tried) to test VS 2013 builds, but while vs2013 in theory supports mixed declarations and code, in practice that support is broken, and failed to build toke.obj:
The one case I looked at in detail, VS 2013 required an extra ; after a conditional statement to accept the following declaration, for example:
regcomp.obj also failed to build due to the use of the "inline" keyword in regcomp.h. This is fairly trivially fixable but inline is also C99.
Despite these build issues we haven't received any error reports for VS2013, so I don't think it's worth re-working any mixed declarations to support it.
It might be worth updating regcomp.h to use PERL_STATIC_INLINE but that's out of scope for this commit.