Selaa lähdekoodia

Changing to use ifdef. The auto-return version of ensure is not the default any more.

Samuel Jaffe 9 vuotta sitten
vanhempi
commit
c1d99570e7
2 muutettua tiedostoa jossa 249 lisäystä ja 3 poistoa
  1. 3 3
      expect.hpp
  2. 246 0
      expect.xcodeproj/project.pbxproj

+ 3 - 3
expect.hpp

@@ -62,13 +62,13 @@ namespace contract {
     expr pop_exception( __VA_ARGS__ ), \
     get_default_message( "precondition failed: ", expr ) )
 
-/*
+#if ! defined( EXPECT_USE_ENSURE_AUTORETURN_BEHAVIOR )
 #define ensures( cond, ... ) \
   contract::_contract_impl< exception_type( std::runtime_error, ##__VA_ARGS__ )>( \
     cond , ##__VA_ARGS__ , \
     get_default_message( "postcondition failed: ", cond ) )
- */
 
+#else
 /**
  * RVO works if expr is an rvalue, but not if it is an
  * lvalue. e.g:
@@ -87,4 +87,4 @@ namespace contract {
         get_default_message( "postcondition failed: ", cond ) ); \
     return _; \
   }( )
-
+#endif

+ 246 - 0
expect.xcodeproj/project.pbxproj

@@ -0,0 +1,246 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		CD2973D31D7B684400E37217 /* expect.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD2973D21D7B684400E37217 /* expect.hpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		CD2973C41D7B67EF00E37217 /* libexpect.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libexpect.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+		CD2973D21D7B684400E37217 /* expect.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = expect.hpp; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		CD2973C11D7B67EF00E37217 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		CD2973BB1D7B67EF00E37217 = {
+			isa = PBXGroup;
+			children = (
+				CD2973D21D7B684400E37217 /* expect.hpp */,
+				CD2973C51D7B67EF00E37217 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		CD2973C51D7B67EF00E37217 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				CD2973C41D7B67EF00E37217 /* libexpect.dylib */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+		CD2973C21D7B67EF00E37217 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CD2973D31D7B684400E37217 /* expect.hpp in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+		CD2973C31D7B67EF00E37217 /* expect */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CD2973CF1D7B67EF00E37217 /* Build configuration list for PBXNativeTarget "expect" */;
+			buildPhases = (
+				CD2973C01D7B67EF00E37217 /* Sources */,
+				CD2973C11D7B67EF00E37217 /* Frameworks */,
+				CD2973C21D7B67EF00E37217 /* Headers */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = expect;
+			productName = expect;
+			productReference = CD2973C41D7B67EF00E37217 /* libexpect.dylib */;
+			productType = "com.apple.product-type.library.dynamic";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		CD2973BC1D7B67EF00E37217 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0720;
+				ORGANIZATIONNAME = "Sam Jaffe";
+				TargetAttributes = {
+					CD2973C31D7B67EF00E37217 = {
+						CreatedOnToolsVersion = 7.2.1;
+					};
+				};
+			};
+			buildConfigurationList = CD2973BF1D7B67EF00E37217 /* Build configuration list for PBXProject "expect" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = CD2973BB1D7B67EF00E37217;
+			productRefGroup = CD2973C51D7B67EF00E37217 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				CD2973C31D7B67EF00E37217 /* expect */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+		CD2973C01D7B67EF00E37217 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		CD2973CD1D7B67EF00E37217 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_IDENTITY = "-";
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.10;
+				MTL_ENABLE_DEBUG_INFO = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = macosx;
+			};
+			name = Debug;
+		};
+		CD2973CE1D7B67EF00E37217 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				CODE_SIGN_IDENTITY = "-";
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				MACOSX_DEPLOYMENT_TARGET = 10.10;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				SDKROOT = macosx;
+			};
+			name = Release;
+		};
+		CD2973D01D7B67EF00E37217 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_CPP_EXCEPTIONS = YES;
+				GCC_ENABLE_CPP_RTTI = YES;
+				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		CD2973D11D7B67EF00E37217 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				DYLIB_COMPATIBILITY_VERSION = 1;
+				DYLIB_CURRENT_VERSION = 1;
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_CPP_EXCEPTIONS = YES;
+				GCC_ENABLE_CPP_RTTI = YES;
+				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		CD2973BF1D7B67EF00E37217 /* Build configuration list for PBXProject "expect" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CD2973CD1D7B67EF00E37217 /* Debug */,
+				CD2973CE1D7B67EF00E37217 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		CD2973CF1D7B67EF00E37217 /* Build configuration list for PBXNativeTarget "expect" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CD2973D01D7B67EF00E37217 /* Debug */,
+				CD2973D11D7B67EF00E37217 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = CD2973BC1D7B67EF00E37217 /* Project object */;
+}