Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
78aee1b1
Commit
78aee1b1
authored
Sep 09, 2016
by
Feng Xiao
Committed by
GitHub
Sep 09, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2044 from wychen/Win32ANSI
Fix Win32 error messages on Unicode build
parents
643a02bc
a7eaf369
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
11 deletions
+21
-11
appveyor.bat
appveyor.bat
+1
-1
appveyor.yml
appveyor.yml
+1
-0
CMakeLists.txt
cmake/CMakeLists.txt
+4
-0
command_line_interface_unittest.cc
...ogle/protobuf/compiler/command_line_interface_unittest.cc
+5
-0
subprocess.cc
src/google/protobuf/compiler/subprocess.cc
+2
-2
file.cc
src/google/protobuf/testing/file.cc
+8
-8
No files found.
appveyor.bat
View file @
78aee1b1
...
...
@@ -10,7 +10,7 @@ goto :error
echo Building C++
mkdir build_msvc
cd build_msvc
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL%
-Dprotobuf_UNICODE=%UNICODE%
../cmake
msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
cd %configuration%
tests.exe || goto error
...
...
appveyor.yml
View file @
78aee1b1
...
...
@@ -11,6 +11,7 @@ environment:
matrix
:
-
language
:
cpp
BUILD_DLL
:
ON
UNICODE
:
ON
-
language
:
csharp
...
...
cmake/CMakeLists.txt
View file @
78aee1b1
...
...
@@ -159,6 +159,10 @@ else (MSVC)
set
(
LIB_PREFIX
)
endif
(
MSVC
)
if
(
protobuf_UNICODE
)
add_definitions
(
-DUNICODE -D_UNICODE
)
endif
(
protobuf_UNICODE
)
include
(
libprotobuf-lite.cmake
)
include
(
libprotobuf.cmake
)
include
(
libprotoc.cmake
)
...
...
src/google/protobuf/compiler/command_line_interface_unittest.cc
View file @
78aee1b1
...
...
@@ -719,6 +719,11 @@ TEST_F(CommandLineInterfaceTest, TrailingBackslash) {
ExpectGenerated
(
"test_generator"
,
""
,
"foo.proto"
,
"Foo"
);
}
TEST_F
(
CommandLineInterfaceTest
,
Win32ErrorMessage
)
{
EXPECT_EQ
(
"The system cannot find the file specified.
\r\n
"
,
Subprocess
::
Win32ErrorMessage
(
ERROR_FILE_NOT_FOUND
));
}
#endif // defined(_WIN32) || defined(__CYGWIN__)
TEST_F
(
CommandLineInterfaceTest
,
PathLookup
)
{
...
...
src/google/protobuf/compiler/subprocess.cc
View file @
78aee1b1
...
...
@@ -261,11 +261,11 @@ string Subprocess::Win32ErrorMessage(DWORD error_code) {
char
*
message
;
// WTF?
FormatMessage
(
FORMAT_MESSAGE_ALLOCATE_BUFFER
|
FormatMessage
A
(
FORMAT_MESSAGE_ALLOCATE_BUFFER
|
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_IGNORE_INSERTS
,
NULL
,
error_code
,
0
,
(
LPT
STR
)
&
message
,
// NOT A BUG!
(
LP
STR
)
&
message
,
// NOT A BUG!
0
,
NULL
);
string
result
=
message
;
...
...
src/google/protobuf/testing/file.cc
View file @
78aee1b1
...
...
@@ -141,12 +141,12 @@ void File::DeleteRecursively(const string& name,
#ifdef _MSC_VER
// This interface is so weird.
WIN32_FIND_DATA
find_data
;
HANDLE
find_handle
=
FindFirstFile
((
name
+
"/*"
).
c_str
(),
&
find_data
);
WIN32_FIND_DATA
A
find_data
;
HANDLE
find_handle
=
FindFirstFile
A
((
name
+
"/*"
).
c_str
(),
&
find_data
);
if
(
find_handle
==
INVALID_HANDLE_VALUE
)
{
// Just delete it, whatever it is.
DeleteFile
(
name
.
c_str
());
RemoveDirectory
(
name
.
c_str
());
DeleteFile
A
(
name
.
c_str
());
RemoveDirectory
A
(
name
.
c_str
());
return
;
}
...
...
@@ -156,15 +156,15 @@ void File::DeleteRecursively(const string& name,
string
path
=
name
+
"/"
+
entry_name
;
if
(
find_data
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
{
DeleteRecursively
(
path
,
NULL
,
NULL
);
RemoveDirectory
(
path
.
c_str
());
RemoveDirectory
A
(
path
.
c_str
());
}
else
{
DeleteFile
(
path
.
c_str
());
DeleteFile
A
(
path
.
c_str
());
}
}
}
while
(
FindNextFile
(
find_handle
,
&
find_data
));
}
while
(
FindNextFile
A
(
find_handle
,
&
find_data
));
FindClose
(
find_handle
);
RemoveDirectory
(
name
.
c_str
());
RemoveDirectory
A
(
name
.
c_str
());
#else
// Use opendir()! Yay!
// lstat = Don't follow symbolic links.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment