Adding an updated patch. It seems I missed a file.
Testing done: compiled with both /permissive- set and without.
Thanks,
-Andrew
From: awt-dev <[email protected]> On Behalf Of Andrew Luo
Sent: Monday, May 13, 2019 5:40 PM
To: [email protected]
Subject: <AWT Dev> [PATCH] Fix some C++ conformance issues in AWT Windows code
I've been trying to get the JDK to compile with the new /permissive- switch in
VS2017 (https://devblogs.microsoft.com/cppblog/permissive-switch/) however
there have been a few issues in various parts of the code.
While testing this, I found some issues in the AWT code. In one case we name a
function with the class:: prefix when the function is declared inline in the
class definition. Other cases include where we are assigning string literals
to non-const char* variables. I took some time to fix these and attached a
patch. Let me know if there are any comments.
c:\Users\Andrew\Documents\mercurial\openjdk\jdk\src\java.desktop\windows\native\libawt\windows\awt.h(343):
error C2440: 'return': cannot convert from 'const unsigned short *' to 'LPWSTR'
c:\Users\Andrew\Documents\mercurial\openjdk\jdk\src\java.desktop\windows\native\libawt\windows\awt.h(343):
note: Conversion from string literal loses const qualifier (see
/Zc:strictStrings)
c:\users\andrew\documents\mercurial\openjdk\jdk\src\java.desktop\windows\native\libawt\windows\awt_Component.h(455):
error C2061: syntax error: identifier 'javaKey'
c:\users\andrew\documents\mercurial\openjdk\jdk\src\java.desktop\windows\native\libawt\windows\awt_Component.h(455):
error C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
Thanks,
-Andrew
ÿþd i f f - r 3 9 8 1 4 e 0 a 8 9 6 4
s r c / j a v a . d e s k t o p / w i n d o w s / n a t i v e / l i b a w t / w i n d o w s / a w t . h
- - -
a / s r c / j a v a . d e s k t o p / w i n d o w s / n a t i v e / l i b a w t / w i n d o w s / a w t . h
S a t M a y 1 8 2 2 : 1 1 : 2 5 2 0 1 9 + 0 2 0 0
+ + +
b / s r c / j a v a . d e s k t o p / w i n d o w s / n a t i v e / l i b a w t / w i n d o w s / a w t . h
S a t M a y 1 8 2 2 : 2 7 : 0 8 2 0 1 9 - 0 7 0 0
@ @ - 3 3 7 , 7 + 3 3 7 , 7 @ @
p r o t e c t e d :
L P W S T R m _ p S t r ;
j s i z e m _ d w S i z e ;
- L P W S T R g e t N o n E m p t y S t r i n g ( ) {
+ L P C W S T R g e t N o n E m p t y S t r i n g ( ) {
r e t u r n ( N U L L = = m _ p S t r )
? L "