From c7efbb55f075748d88e25735c6d7e85ba768fd15 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 7 Mar 2023 22:04:32 +0100 Subject: refactor: use opengl-registry-macros 0.1.0 --- src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 9568b6c..cd2e4d0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,15 +4,15 @@ use opengl_registry_macros::for_each_opengl_command; for_each_opengl_command! { - #[doc = stringify!(_gl_command_)] + #[doc = stringify!(#gl_command_name)] #[allow(non_snake_case, clippy::too_many_arguments)] - pub unsafe fn _gl_command_(_gl_command_args_) -> _gl_command_ret_type_ { + pub unsafe fn #gl_command_name_noprefix(#gl_command_args) -> #gl_command_ret_type { type GLFunc = - unsafe extern "C" fn(_gl_command_arg_types_) -> _gl_command_ret_type_; + unsafe extern "C" fn(#gl_command_arg_types) -> #gl_command_ret_type; - let gl_func = std::mem::transmute::<_, GLFunc>(functions::_gl_command_); + let gl_func = std::mem::transmute::<_, GLFunc>(functions::#gl_command_name); - gl_func(_gl_command_arg_names_) + gl_func(#gl_command_arg_names) } } @@ -39,7 +39,7 @@ where { for_each_opengl_command! { unsafe { - functions::_gl_command_ = get_proc_addr(stringify!(_gl_command_)); + functions::#gl_command_name = get_proc_addr(stringify!(#gl_command_name)); } }; } @@ -49,9 +49,9 @@ mod functions use opengl_registry_macros::for_each_opengl_command; for_each_opengl_command!( - #[doc = stringify!(_gl_command_)] + #[doc = stringify!(#gl_command_name)] #[allow(non_upper_case_globals)] - pub static mut _gl_command_: unsafe extern "C" fn() = function_not_loaded; + pub static mut #gl_command_name: unsafe extern "C" fn() = function_not_loaded; ); extern "C" fn function_not_loaded() -- cgit v1.2.3-18-g5258