aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--appveyor.bat2
-rw-r--r--appveyor.yml1
-rw-r--r--cmake/CMakeLists.txt4
-rw-r--r--src/google/protobuf/testing/file.cc16
4 files changed, 14 insertions, 9 deletions
diff --git a/appveyor.bat b/appveyor.bat
index 0e6dd520..58cc9355 100644
--- a/appveyor.bat
+++ b/appveyor.bat
@@ -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% -DUNICODE=%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
diff --git a/appveyor.yml b/appveyor.yml
index 2ea3cb78..20fc8ade 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -11,6 +11,7 @@ environment:
matrix:
- language: cpp
BUILD_DLL: ON
+ UNICODE: ON
- language: csharp
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index f947b741..8c374b7e 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -159,6 +159,10 @@ else (MSVC)
set(LIB_PREFIX)
endif (MSVC)
+if (UNICODE)
+ add_definitions(-DUNICODE -D_UNICODE)
+endif (UNICODE)
+
include(libprotobuf-lite.cmake)
include(libprotobuf.cmake)
include(libprotoc.cmake)
diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc
index bc76c844..470512ed 100644
--- a/src/google/protobuf/testing/file.cc
+++ b/src/google/protobuf/testing/file.cc
@@ -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_DATAA find_data;
+ HANDLE find_handle = FindFirstFileA((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());
+ DeleteFileA(name.c_str());
+ RemoveDirectoryA(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());
+ RemoveDirectoryA(path.c_str());
} else {
- DeleteFile(path.c_str());
+ DeleteFileA(path.c_str());
}
}
- } while(FindNextFile(find_handle, &find_data));
+ } while(FindNextFileA(find_handle, &find_data));
FindClose(find_handle);
- RemoveDirectory(name.c_str());
+ RemoveDirectoryA(name.c_str());
#else
// Use opendir()! Yay!
// lstat = Don't follow symbolic links.