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)]