Fix build warnings on macOS/Windows

This commit is contained in:
Kirill Chibisov 2020-05-27 17:46:52 +03:00 committed by GitHub
parent 88d87cfa86
commit a14c51797f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -31,9 +31,9 @@ use parking_lot::MutexGuard;
#[cfg(not(any(target_os = "macos", windows)))] #[cfg(not(any(target_os = "macos", windows)))]
use wayland_client::{Display as WaylandDisplay, EventQueue}; use wayland_client::{Display as WaylandDisplay, EventQueue};
use font::{self, Rasterize};
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use font::set_font_smoothing; use font::set_font_smoothing;
use font::{self, Rasterize};
use alacritty_terminal::config::{Font, StartupMode}; use alacritty_terminal::config::{Font, StartupMode};
use alacritty_terminal::event::{Event, OnResize}; use alacritty_terminal::event::{Event, OnResize};

View File

@ -22,9 +22,9 @@ use glutin::platform::unix::EventLoopWindowTargetExtUnix;
use log::{debug, info, warn}; use log::{debug, info, warn};
use serde_json as json; use serde_json as json;
use font::{self, Size};
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
use font::set_font_smoothing; use font::set_font_smoothing;
use font::{self, Size};
use alacritty_terminal::clipboard::ClipboardType; use alacritty_terminal::clipboard::ClipboardType;
use alacritty_terminal::config::Font; use alacritty_terminal::config::Font;

View File

@ -930,6 +930,7 @@ impl<'a, C> RenderApi<'a, C> {
} }
} }
#[cfg(not(any(target_os = "macos", windows)))]
pub fn finish(&self) { pub fn finish(&self) {
unsafe { unsafe {
gl::Finish(); gl::Finish();

View File

@ -281,7 +281,6 @@ pub struct Font {
unsafe impl Send for Font {} unsafe impl Send for Font {}
/// Set subpixel anti-aliasing on macOS. /// Set subpixel anti-aliasing on macOS.
/// ///
/// Sub-pixel anti-aliasing has been disabled since macOS Mojave by default. This function allows /// Sub-pixel anti-aliasing has been disabled since macOS Mojave by default. This function allows
@ -294,7 +293,7 @@ pub fn set_font_smoothing(enable: bool) {
unsafe { unsafe {
// Check that we're running at least Mojave (10.14.0+). // Check that we're running at least Mojave (10.14.0+).
if !NSProcessInfo::processInfo(nil).isOperatingSystemAtLeastVersion(min_macos_version) { if !NSProcessInfo::processInfo(nil).isOperatingSystemAtLeastVersion(min_macos_version) {
return return;
} }
let key = NSString::alloc(nil).init_str("CGFontRenderingFontSmoothingDisabled"); let key = NSString::alloc(nil).init_str("CGFontRenderingFontSmoothingDisabled");