From 2d8ded2111e9e8da4221a9fe88d9928af68be8cf Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 5 Mar 2024 17:03:33 +0900 Subject: [PATCH] Move `ffi` module to separate file --- src/ffi.rs | 14 ++++++++++++++ src/main.rs | 17 +---------------- 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 src/ffi.rs diff --git a/src/ffi.rs b/src/ffi.rs new file mode 100644 index 0000000..798fdf7 --- /dev/null +++ b/src/ffi.rs @@ -0,0 +1,14 @@ +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(unused_imports)] +#![allow(dead_code)] +include!(concat!(env!("OUT_DIR"), "/glfw_vk_bindings.rs")); + +pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 { + (major << 22) | (minor << 12) | patch +} + +pub fn VK_MAKE_API_VERSION(variant: u32, major: u32, minor: u32, patch: u32) -> u32 { + (variant << 29) | (major << 22) | (minor << 12) | patch +} diff --git a/src/main.rs b/src/main.rs index 3135e9a..d1ae0ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,19 +1,4 @@ -mod ffi { - #![allow(non_upper_case_globals)] - #![allow(non_camel_case_types)] - #![allow(non_snake_case)] - #![allow(unused_imports)] - #![allow(dead_code)] - include!(concat!(env!("OUT_DIR"), "/glfw_vk_bindings.rs")); - - pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 { - (major << 22) | (minor << 12) | patch - } - - pub fn VK_MAKE_API_VERSION(variant: u32, major: u32, minor: u32, patch: u32) -> u32 { - (variant << 29) | (major << 22) | (minor << 12) | patch - } -} +mod ffi; use std::collections::HashSet; use std::ffi::{CStr, CString};