Skip to content

Commit f3e6cfb

Browse files
committed
f
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
1 parent 8535ec2 commit f3e6cfb

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/platform/generic/egl/device.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ use libc::{dlopen, dlsym, RTLD_LAZY};
1313
#[cfg(target_os = "windows")]
1414
use winapi::shared::minwindef::HMODULE;
1515
#[cfg(target_os = "windows")]
16-
use winapi::shared::ntdef::LPCSTR;
17-
#[cfg(target_os = "windows")]
1816
use winapi::um::libloaderapi;
1917

2018
thread_local! {
@@ -58,7 +56,7 @@ unsafe impl Sync for EGLLibraryWrapper {}
5856
fn get_proc_address(symbol_name: &str) -> *const c_void {
5957
unsafe {
6058
let symbol_name: CString = CString::new(symbol_name).unwrap();
61-
let symbol_ptr = symbol_name.as_ptr.cast::<LPCSTR>();
59+
let symbol_ptr = symbol_name.as_ptr();
6260
libloaderapi::GetProcAddress(EGL_LIBRARY.0, symbol_ptr).cast()
6361
}
6462
}

src/platform/windows/wgl/context.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::ptr;
2020
use std::thread;
2121
use winapi::shared::minwindef::{BOOL, FALSE, FLOAT, HMODULE, LPARAM, LPVOID, LRESULT, UINT};
2222
use winapi::shared::minwindef::{WORD, WPARAM};
23-
use winapi::shared::ntdef::{HANDLE, LPCSTR};
23+
use winapi::shared::ntdef::HANDLE;
2424
use winapi::shared::windef::{HBRUSH, HDC, HGLRC, HWND};
2525
use winapi::um::libloaderapi;
2626
use winapi::um::wingdi::{self, PFD_DOUBLEBUFFER, PFD_DRAW_TO_WINDOW, PFD_MAIN_PLANE};
@@ -659,7 +659,7 @@ fn extension_loader_thread() -> WGLExtensionFunctions {
659659
let mut extension_functions = WGLExtensionFunctions::default();
660660
let window = winuser::CreateWindowExA(
661661
0,
662-
window_class_atom as LPCSTR,
662+
window_class_atom.cast(),
663663
window_class_name,
664664
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
665665
0,
@@ -870,7 +870,7 @@ fn get_proc_address(symbol_name: &str) -> *const c_void {
870870
unsafe {
871871
// https://www.khronos.org/opengl/wiki/Load_OpenGL_Functions#Windows
872872
let symbol_name: CString = CString::new(symbol_name).unwrap();
873-
let symbol_ptr = symbol_name.as_ptr() as *const u8 as LPCSTR;
873+
let symbol_ptr = symbol_name.as_ptr();
874874
let addr = wglGetProcAddress(symbol_ptr) as *const c_void;
875875
if !addr.is_null() {
876876
return addr;

0 commit comments

Comments
 (0)