From f297339838b17d808bc4caca70abc580d51498a8 Mon Sep 17 00:00:00 2001 From: msiglreith Date: Fri, 1 Dec 2017 00:50:59 +0100 Subject: [PATCH] Fix Makefile --- Makefile | 8 ++++---- src/lib.rs | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 7c7dcc1..5ffe7be 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ TARGET=$(NATIVE_DIR)/test OBJECTS=$(NATIVE_DIR)/test.o LIBRARY=target/debug/libportability.a -CC=gcc +CC=g++ CFLAGS=-ggdb -O0 -I$(VULKAN_DIR) DEPS= LDFLAGS=-lpthread -ldl -lm -lX11 @@ -19,15 +19,15 @@ binding: $(BINDING) $(BINDING): $(VULKAN_DIR)/vulkan/*.h bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING) -$(LIBRARY): src/*.rs Cargo.toml Cargo.lock +$(LIBRARY): src/*.rs Cargo.toml $(wildcard Cargo.lock) cargo build mkdir -p target/native -$(NATIVE_DIR)/%.o: native/%.c $(DEPS) Makefile +$(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile $(CC) -c -o $@ $< $(CFLAGS) $(TARGET): $(LIBRARY) $(OBJECTS) Makefile - $(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LIBRARY) + $(CC) -o $(TARGET) $(OBJECTS) $(LIBRARY) $(LDFLAGS) run: $(TARGET) $(TARGET) diff --git a/src/lib.rs b/src/lib.rs index 09fdbd6..24e2c48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5827,7 +5827,8 @@ pub fn vkCreateWin32SurfaceKHR( pAllocator: *const VkAllocationCallbacks, pSurface: *mut VkSurfaceRawKHR, ) -> VkResult { - if cfg!(target_os = "windows") { + #[cfg(target_os = "windows")] + { unsafe { assert_eq!((*pCreateInfos).flags, 0); assert!(pAllocator.is_null()); @@ -5835,9 +5836,9 @@ pub fn vkCreateWin32SurfaceKHR( *pSurface = Handle::new(instance.create_surface_from_hwnd((*pCreateInfos).hwnd)); VkResult::VK_SUCCESS } - } else { - unreachable!() } + #[cfg(not(target_os = "windows"))] + unreachable!() } #[repr(C)] #[derive(Debug, Copy)]