Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Windows #26

Open
dubcanada opened this issue Jun 29, 2014 · 9 comments
Open

Support Windows #26

dubcanada opened this issue Jun 29, 2014 · 9 comments

Comments

@dubcanada
Copy link

http://win32builder.gnome.org/ has unoffical builds for 3.10 for Windows. Also this is another reason to have #1 to allow Windows people to use 3.6.4 (the last "official" release).

Either way it would be nice to redo the Makefile (or switch to something slightly more cross platform like cmake) to allow for Windows support.

@GuillaumeGomez
Copy link
Contributor

We started to handle multiple versions (3.6, 3.8, 3.10 and 3.12). With this, it should be fine for Windows people to use it.
For the Makefile, we already were speaking about using cmake because it's more pleasant to use. I think it'll be added in a near future.

@dubcanada
Copy link
Author

Window's dies while running rgtk-build at the moment. Access violation error for one of the pointers. Glue builds and appears to work fine.

@GuillaumeGomez
Copy link
Contributor

@jeremyletang and myself aren't developing under windows. We'll test more on this platform when the development will be in a more advanced stage I think. Feel free to create a pull request if you fix that issue and thank you for your interest.

@dubcanada
Copy link
Author

I played around with this a bunch, I just can't get past the rust compilation error. I am not sure if it is a Rust compiler error as there are a bunch of them on Windows. Or it is related to something else.

I reported it anyways rust-lang/rust#15811

@klutzy
Copy link

klutzy commented Aug 14, 2014

The ICE on rust-lang/rust#15811 is triggered by src/gtk/signals.rs#L239:

signal!(show_help, ShowHelp(help_type : gtk::WidgetHelpType) -> bool)

which defines pub extern fn trampoline(widget: *mut ffi::C_GtkWidget, help_type: gtk::WidgetHelpType, ...) where struct WidgetHelpType; is empty.
Is it intended? It seems like *mut WidgetHelpType is appropriate but I don't know details.

@jeremyletang
Copy link
Owner

@klutzy thanks for the help !

It seems that WidgetHelpType was an enum, if change this in my last commit, maybe this fix the ICE?
Anyone on Windows can try ?

@dubcanada
Copy link
Author

I'll give it a try later today.

@klutzy
Copy link

klutzy commented Aug 14, 2014

(rust-lang/rust#16484 fixed the ICE issue!)
The remaining issue is that some codes assume pointer is 64-bit. (this seems relevant for 32-bit linux as well?)

--- a/src/cairo/fonts.rs
+++ b/src/cairo/fonts.rs
@@ -111,7 +111,7 @@ impl FontOptions{

     pub fn hash(&self) -> u64{
         unsafe{
-            ffi::cairo_font_options_hash(self.get_ptr())
+            ffi::cairo_font_options_hash(self.get_ptr()) as u64
         }
     }

--- a/src/gtk/traits/recentchooser.rs
+++ b/src/gtk/traits/recentchooser.rs
@@ -176,7 +176,7 @@ pub trait RecentChooser: traits::Widget {
     }

     fn get_uris(&self) -> Option<Vec<String>> {
-        let mut length = 0i64;
+        let mut length = 0;
         let tmp = unsafe { ffi::gtk_recent_chooser_get_uris(GTK_RECENT_CHOOSER(self.get_widget()), &mut length) }
         if tmp.is_null() {
@@ -184,7 +184,7 @@ pub trait RecentChooser: traits::Widget {
         } else {
             let mut ret = Vec::with_capacity(length as uint);

-            for count in range(0i64, length) {
+            for count in range(0, length) {
                 ret.push(unsafe { string::raw::from_buf(*tmp.offset(count as int) as *const u8) });
             }
             Some(ret)

diff --git a/src/gtk/widgets/recentinfo.rs b/src/gtk/widgets/recentinfo.rs
index be2aa4d..107d08c 100644
--- a/src/gtk/widgets/recentinfo.rs
+++ b/src/gtk/widgets/recentinfo.rs
@@ -115,7 +115,7 @@ impl RecentInfo {
     }

     pub fn get_applications(&self) -> Option<Vec<String>> {

         if tmp.is_null() {;
@@ -123,7 +123,7 @@ impl RecentInfo {recent_info_get_applications(GTK_RECENT_INFO(self.get_widget()), &mut length)         } else {
             let mut ret = Vec::with_capacity(length as uint);

-            for count in range(0i64, length) {
+            for count in range(0, length) {
                 ret.push(unsafe { string::raw::from_buf(*tmp.offset(count as int) as *const u8) });
             }
             Some(ret)
@@ -150,7 +150,7 @@ impl RecentInfo {
     }

     pub fn get_groups(&self) -> Option<Vec<String>> {
-        let mut length = 0i64;
+        let mut length = 0;
         let tmp = unsafe { ffi::gtk_recent_info_get_groups(GTK_RECENT_INFO(self.get_widget()), &mut length) };

         if tmp.is_null() {
@@ -158,7 +158,7 @@ impl RecentInfo {
         } else {
             let mut ret = Vec::with_capacity(length as uint);

-            for count in range(0i64, length) {
+            for count in range(0, length) {
                 ret.push(unsafe { string::raw::from_buf(*tmp.offset(count as int) as *const u8) });
             }
             Some(ret)

After touching some lines, I've succeeded to get librgtk.rlib. So the "build" issue is nearly done!

@GuillaumeGomez
Copy link
Contributor

Oh nice ! I like when bugs nearly disappear by themselves haha. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants