Fixed Windows version

This commit is contained in:
Daniel Collin 2015-11-23 20:21:11 +01:00
parent 7aa0ca5125
commit 48da30a25f
3 changed files with 11 additions and 4 deletions

View file

@ -29,7 +29,7 @@ fn main() {
Status
------
Currently Mac has been tested. Windows and Linux will be tested and verified soon.
Currently Mac and Windows has been tested. Linux will be tested and verified soon.
Build instructions

View file

@ -3,14 +3,23 @@ use std::ffi::CString;
use std::mem::transmute;
use libc::{c_char, c_int, c_void};
#[cfg(target_os = "macos")]
#[link(name = "Cocoa", kind = "framework")]
#[link(name = "minifb_native")]
extern {
fn mfb_open(name: *const c_char, width: c_int, height: c_int) -> c_int;
fn mfb_update(buffer: *mut c_void) -> c_int;
fn mfb_close();
}
#[cfg(target_os = "windows")]
#[link(name = "gdi32")]
extern {
fn mfb_open(name: *const c_char, width: c_int, height: c_int) -> c_int;
fn mfb_update(buffer: *mut c_void) -> c_int;
fn mfb_close();
}
///
/// Open up a window
///

View file

@ -1,5 +1,3 @@
#include <MiniFB.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>