mirror of
https://github.com/boostorg/system.git
synced 2025-07-29 20:17:13 +02:00
Neither MinGW or Cygwin versions of winerror.h work if used alone, so on either of these platforms include the full windows.h. Move reporting of configuration to a separate config_test.cpp program, and expand the coverage to report more macros.
This commit is contained in:
@ -18,7 +18,15 @@
|
||||
#ifdef BOOST_WINDOWS_API
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
// Neither MinGW or Cygwin versions of winerror.h work if used alone, so on
|
||||
// either of those platforms include the full windows.h
|
||||
|
||||
#if defined(__MINGW32__) || defined(__CYGWIN__)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <winerror.h>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
@ -52,4 +52,7 @@ project
|
||||
[ run header_only_test.cpp
|
||||
: : : <link>static
|
||||
]
|
||||
[ run config_test.cpp
|
||||
: : : <test-info>always_show_run_output
|
||||
]
|
||||
;
|
||||
|
64
test/config_test.cpp
Normal file
64
test/config_test.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
// error_code_test.cpp ---------------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2014
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// See library home page at http://www.boost.org/libs/system
|
||||
|
||||
#include <boost/system/config.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef BOOST_WINDOWS_API
|
||||
std::cout << "BOOST_WINDOWS_API is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_WINDOWS_API is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
std::cout << "_MSC_VER is defined as " << _MSC_VER << std::endl;
|
||||
#else
|
||||
std::cout << "_MSC_VER is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef __CYGWIN__
|
||||
std::cout << "__CYGWIN__ is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "__CYGWIN__ is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef __MINGW32__
|
||||
std::cout << "__MINGW32__ is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "__MINGW32__ is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_POSIX_API
|
||||
std::cout << "BOOST_POSIX_API is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_POSIX_API is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_PLAT_WINDOWS_DESKTOP
|
||||
std::cout << "BOOST_PLAT_WINDOWS_DESKTOP is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_PLAT_WINDOWS_DESKTOP is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
std::cout << "BOOST_NO_ANSI_APIS is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_NO_ANSI_APIS is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_NO_CXX11_NOEXCEPT
|
||||
std::cout << "BOOST_NO_CXX11_NOEXCEPT is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_NO_CXX11_NOEXCEPT is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||
std::cout << "BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS is not defined" << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
@ -59,37 +59,6 @@ namespace
|
||||
int main( int, char ** )
|
||||
{
|
||||
|
||||
#ifdef BOOST_WINDOWS_API
|
||||
std::cout << "BOOST_WINDOWS_API is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_WINDOWS_API is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_POSIX_API
|
||||
std::cout << "BOOST_POSIX_API is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_POSIX_API is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_PLAT_WINDOWS_DESKTOP
|
||||
std::cout << "BOOST_PLAT_WINDOWS_DESKTOP is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_PLAT_WINDOWS_DESKTOP is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_NO_ANSI_APIS
|
||||
std::cout << "BOOST_NO_ANSI_APIS is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_NO_ANSI_APIS is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_NO_CXX11_NOEXCEPT
|
||||
std::cout << "BOOST_NO_CXX11_NOEXCEPT is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_NO_CXX11_NOEXCEPT is not defined" << std::endl;
|
||||
#endif
|
||||
#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||
std::cout << "BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS is defined" << std::endl;
|
||||
#else
|
||||
std::cout << "BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS is not defined" << std::endl;
|
||||
#endif
|
||||
|
||||
std::cout << "Conversion use cases...\n";
|
||||
error_condition x1( errc::file_exists );
|
||||
//error_code x2( errc::file_exists ); // should fail to compile
|
||||
|
88
test/system/config_test/config_test.vcxproj
Normal file
88
test/system/config_test/config_test.vcxproj
Normal file
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E18C2B56-DCEC-438F-9C38-3C8B08B65247}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>config_test</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\common.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\common.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\config_test.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,12 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2013 for Windows Desktop
|
||||
VisualStudioVersion = 12.0.30626.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system-dll", "system-dll\system-dll.vcxproj", "{419402D4-F990-4B05-A459-655E2DC33DC2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_code_test", "error_code_test\error_code_test.vcxproj", "{E50C14DC-547D-4C33-83EA-653C0D0D4E64}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "header_only_test", "header_only_test\header_only_test.vcxproj", "{3773451B-A618-4A26-A7F2-85554F4BD21B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "config_test", "config_test\config_test.vcxproj", "{E18C2B56-DCEC-438F-9C38-3C8B08B65247}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -25,6 +29,10 @@ Global
|
||||
{3773451B-A618-4A26-A7F2-85554F4BD21B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3773451B-A618-4A26-A7F2-85554F4BD21B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3773451B-A618-4A26-A7F2-85554F4BD21B}.Release|Win32.Build.0 = Release|Win32
|
||||
{E18C2B56-DCEC-438F-9C38-3C8B08B65247}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E18C2B56-DCEC-438F-9C38-3C8B08B65247}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E18C2B56-DCEC-438F-9C38-3C8B08B65247}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E18C2B56-DCEC-438F-9C38-3C8B08B65247}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
Reference in New Issue
Block a user