Skip to content

Commit

Permalink
Use variable "system" which allows to distinguish MACOSX
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris00 committed Dec 7, 2015
1 parent 359fcbb commit 9ae8032
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open Ocamlbuild_plugin
let env = BaseEnvLight.load() (* setup.data *)

let arch = String.uppercase(BaseEnvLight.var_get "architecture" env)
let os_type = String.uppercase(BaseEnvLight.var_get "os_type" env)
let system = String.uppercase(BaseEnvLight.var_get "system" env)
let has_usb = bool_of_string(BaseEnvLight.var_get "has_usb" env)
let ocaml_version = BaseEnvLight.var_get "ocaml_version" env

Expand All @@ -21,7 +21,7 @@ let my_dispatch = function
"src" / "unixsupport_win.h"];
(* _tags cannot used in FilesAB (sic), configure preprocessing here. *)
let pp = sprintf "cppo -D %s -D %s%s -V OCAML:%s"
os_type arch (if has_usb then " -D HAS_USB" else "")
system arch (if has_usb then " -D HAS_USB" else "")
ocaml_version in
let pp = S[A "-pp"; A pp] in
flag ["pp_mindstorm"; "ocamldep"] pp;
Expand Down
2 changes: 1 addition & 1 deletion src/mindstorm_EV3.ml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let connect_bluetooth tty =
close = Unix.close;
msg_counter = 0 }

#elif defined WIN32
#elif defined WIN32 || defined WIN64 || defined CYGWIN
(* Windows *)
external socket_bluetooth : string -> Unix.file_descr
= "ocaml_mindstorm_connect"
Expand Down
4 changes: 2 additions & 2 deletions src/mindstorm_NXT.ml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ struct
let connect ?(check_status=false) socket = failwith "Not yet implemented"
(* libusb should work *)

#elif defined WIN32 || defined CYGWIN
#elif defined WIN32 || defined WIN64 || defined CYGWIN
(* Windows *)
let bricks () = []
let connect ?(check_status=false) socket = failwith "Not yet implemented"
Expand Down Expand Up @@ -252,7 +252,7 @@ let connect_bluetooth ?(check_status=false) tty =
close = Unix.close;
check_status = check_status }

#elif defined WIN32 || defined CYGWIN
#elif defined WIN32 || defined WIN64 || defined CYGWIN
(* Windows *)
external socket_bluetooth : string -> Unix.file_descr
= "ocaml_mindstorm_connect"
Expand Down
2 changes: 1 addition & 1 deletion src/mindstorm_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let min i j = if (i:int) < j then i else j

(* [really_input fd buf ofs len] reads [len] bytes from [fd] and store
them into [buf] starting at position [ofs]. *)
#ifdef WIN32
#if defined WIN32 || defined WIN64 || defined CYGWIN
let really_input_fd =
let rec loop ntries fd buf i n =
if ntries > 50 && i = 0 then
Expand Down

0 comments on commit 9ae8032

Please sign in to comment.