-
-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
@GuillaumeGomez, @sdroege, @tmiasko |
@@ -3675,7 +3675,7 @@ pub struct GdkEventTouchpadPinch { | |||
pub type_: GdkEventType, | |||
pub window: *mut GdkWindow, | |||
pub send_event: i8, | |||
pub phase: GdkTouchpadGesturePhase, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it normal?
Yes, you merged patch to gir-files today, see gtk-rs/gir#555 (comment) for reasoning |
Indeed, then all good for me! |
glib-sys/src/lib.rs
Outdated
//pub const G_GUINT64_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
//pub const G_GUINTPTR_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
pub const G_GUINT64_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
pub const G_GUINTPTR_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants are all useless in Rust. They only make sense with printf-style API, but fortunately we have a better format string system in Rust
glib-sys/src/lib.rs
Outdated
pub const G_GSIZE_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
pub const G_GSIZE_MODIFIER: *const c_char = b"l\0" as *const u8 as *const c_char; | ||
pub const G_GSSIZE_FORMAT: *const c_char = b"li\0" as *const u8 as *const c_char; | ||
pub const G_GSSIZE_MODIFIER: *const c_char = b"l\0" as *const u8 as *const c_char; | ||
pub const G_GUINT16_FORMAT: *const c_char = b"hu\0" as *const u8 as *const c_char; | ||
pub const G_GUINT32_FORMAT: *const c_char = b"u\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. even these existing ones were useless.
glib-sys/src/lib.rs
Outdated
pub const G_GUINT16_FORMAT: *const c_char = b"hu\0" as *const u8 as *const c_char; | ||
pub const G_GUINT32_FORMAT: *const c_char = b"u\0" as *const u8 as *const c_char; | ||
//pub const G_GUINT64_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
//pub const G_GUINTPTR_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
pub const G_GUINT64_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one for example is platform dependent. Both CPU and compiler (MSVC again)
Then I ignore it again |
Ignored more constants Still don't contains update to right gir submodule. |
Appveyor failed on 64x build as glib have some GPid functions. |
glib-sys/src/lib.rs
Outdated
//pub const G_GINT64_FORMAT: *const c_char = b"li\0" as *const u8 as *const c_char; | ||
//pub const G_GINT64_MODIFIER: *const c_char = b"l\0" as *const u8 as *const c_char; | ||
//pub const G_GINTPTR_FORMAT: *const c_char = b"li\0" as *const u8 as *const c_char; | ||
//pub const G_GINTPTR_MODIFIER: *const c_char = b"l\0" as *const u8 as *const c_char; | ||
pub const G_GNUC_FUNCTION: *const c_char = b"\0" as *const u8 as *const c_char; | ||
pub const G_GNUC_PRETTY_FUNCTION: *const c_char = b"\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are also both useless, needs a C compiler to do something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
glib-sys/src/lib.rs
Outdated
@@ -648,24 +651,8 @@ pub const G_DATE_BAD_YEAR: c_int = 0; | |||
pub const G_DIR_SEPARATOR: c_int = 92; | |||
pub const G_DIR_SEPARATOR_S: *const c_char = b"\\\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two are platform specific (hello Windows)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I just ignored it wrong.
glib-sys/src/lib.rs
Outdated
pub const G_GUINT16_FORMAT: *const c_char = b"hu\0" as *const u8 as *const c_char; | ||
pub const G_GUINT32_FORMAT: *const c_char = b"u\0" as *const u8 as *const c_char; | ||
//pub const G_GUINT64_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
//pub const G_GUINTPTR_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
pub const G_HAVE_GINT64: c_int = 1; | ||
pub const G_HAVE_GNUC_VARARGS: c_int = 1; | ||
pub const G_HAVE_GNUC_VISIBILITY: c_int = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 are useless outside C too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
glib-sys/src/lib.rs
Outdated
@@ -720,10 +707,6 @@ pub const G_MAXUINT32: u32 = 4294967295; | |||
pub const G_MAXUINT64: u64 = 18446744073709551615; | |||
pub const G_MAXUINT8: u8 = 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as are these
glib-sys/src/lib.rs
Outdated
//pub const G_MININT16: i16 = -32768; | ||
//pub const G_MININT32: i32 = -2147483648; | ||
pub const G_MININT64: i64 = -9223372036854775808; | ||
//pub const G_MININT8: i8 = -128; | ||
pub const GLIB_MINOR_VERSION: c_int = 54; | ||
pub const G_MODULE_SUFFIX: *const c_char = b"so\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is platform specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
glib-sys/src/lib.rs
Outdated
@@ -740,10 +723,6 @@ pub const G_PRIORITY_HIGH_IDLE: c_int = 100; | |||
pub const G_PRIORITY_LOW: c_int = 300; | |||
pub const G_SEARCHPATH_SEPARATOR: c_int = 59; | |||
pub const G_SEARCHPATH_SEPARATOR_S: *const c_char = b";\0" as *const u8 as *const c_char; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Platform specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO is not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ;
on Windows and :
everywhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, really.
Strange that it have constant name="SEARCHPATH_SEPARATOR_S" value=";" c:type="G_SEARCHPATH_SEPARATOR_S
in ubuntu GLib-2.0.gir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a bug in g-ir-scanner. It tries to parse macro definition without actually implementing a proper C preprocessing step. If macros have conditional definitions then it is quite likely to give wrong results.
It would be nice to extend ABI checker to constants as well. I would expect to find a lot of incorrect things there.
glib-sys/src/manual.rs
Outdated
use libc::{c_int, c_ushort}; | ||
|
||
#[cfg(all(windows,target_arch="x86_64"))] | ||
pub type GPid = i64; //Actually HANDLE aka void* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a *mut c_void
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depend of #82 discussion
Basically most of the GLib constants are not very useful. Opt-in instead of opt-out for each of them would be more convenient I guess |
Bad that we can't Opt-in for constants in sys mode |
Fixed almost all nits. |
Almost final version, only may have changes from glib problem. |
I restarted Appveyor. |
glib-sys/src/lib.rs
Outdated
//pub const G_GUINTPTR_FORMAT: *const c_char = b"lu\0" as *const u8 as *const c_char; | ||
pub const G_HAVE_GINT64: c_int = 1; | ||
pub const G_HAVE_GNUC_VARARGS: c_int = 1; | ||
pub const G_HAVE_GNUC_VISIBILITY: c_int = 1; | ||
pub const G_HAVE_GROWING_STACK: c_int = 0; | ||
pub const G_HAVE_ISO_VARARGS: c_int = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should go away, these two. basically all G_HAVE_.* and G_.*FORMAT and G_.*MODIFIER
glib-sys/src/lib.rs
Outdated
//pub const G_MININT16: i16 = -32768; | ||
//pub const G_MININT32: i32 = -2147483648; | ||
pub const G_MININT64: i64 = -9223372036854775808; | ||
//pub const G_MININT8: i8 = -128; | ||
pub const GLIB_MINOR_VERSION: c_int = 54; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As written in another ticket somewhere, these are kind of useless too
pub type GPid = *mut c_void; | ||
|
||
#[cfg(not(windows))] | ||
pub type GPid = c_int; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
pub struct GPollFD { | ||
pub fd: c_int, | ||
pub events: c_ushort, | ||
pub revents: c_ushort, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
bcf5421
to
d826521
Compare
Removed version constants in glib and in others. |
@GuillaumeGomez IMHO this ready for merge now |
Indeed, thanks! |
Apply gtk-rs/gir-files#15
Also contains deignoring string constants