-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-1546: [GLib] Support GLib 2.40 again #1106
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
Conversation
c_glib/arrow-glib/gobject-type.h
Outdated
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.
Since GLib is LGPL (which is Category X) I wanted to check that this code did not come from that codebase
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.
GLib's implementation is here: https://git.gnome.org/browse/glib/tree/gobject/gtype.h#n1395
This implementation generates codes based on
arrow/c_glib/arrow-glib/array.h
Lines 28 to 60 in c1492bf
| #define GARROW_TYPE_ARRAY \ | |
| (garrow_array_get_type()) | |
| #define GARROW_ARRAY(obj) \ | |
| (G_TYPE_CHECK_INSTANCE_CAST((obj), GARROW_TYPE_ARRAY, GArrowArray)) | |
| #define GARROW_ARRAY_CLASS(klass) \ | |
| (G_TYPE_CHECK_CLASS_CAST((klass), GARROW_TYPE_ARRAY, GArrowArrayClass)) | |
| #define GARROW_IS_ARRAY(obj) \ | |
| (G_TYPE_CHECK_INSTANCE_TYPE((obj), GARROW_TYPE_ARRAY)) | |
| #define GARROW_IS_ARRAY_CLASS(klass) \ | |
| (G_TYPE_CHECK_CLASS_TYPE((klass), GARROW_TYPE_ARRAY)) | |
| #define GARROW_ARRAY_GET_CLASS(obj) \ | |
| (G_TYPE_INSTANCE_GET_CLASS((obj), GARROW_TYPE_ARRAY, GArrowArrayClass)) | |
| typedef struct _GArrowArray GArrowArray; | |
| typedef struct _GArrowArrayClass GArrowArrayClass; | |
| /** | |
| * GArrowArray: | |
| * | |
| * It wraps `arrow::Array`. | |
| */ | |
| struct _GArrowArray | |
| { | |
| /*< private >*/ | |
| GObject parent_instance; | |
| }; | |
| struct _GArrowArrayClass | |
| { | |
| GObjectClass parent_class; | |
| }; | |
| GType garrow_array_get_type (void) G_GNUC_CONST; |
Defining macros such as GARROW_ARRAY() by "static inline" function idea is taken from GLib's implementation. Others aren't taken.
It seems that the idea (implementing convenient functions by "static inline" function instead of macro) is a generic C technique. I know that Ruby is also uses the technique such as https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L307-L320 .
So I think that this code isn't LGPL-ed work.
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.
No problem, thank you. Since this was feature backporting issue I just wanted to check. Reusing implementation ideas is no problem so long as actual lines of Category X code are not being redistributed or otherwise directly ported
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.
Thanks for checking license issue!
|
Can you also rebase on master? |
Ubuntu 14.04 ships GLib 2.40.
daadd3f to
cbcdf9a
Compare
|
Done. |
wesm
left a comment
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.
+1
Ubuntu 14.04 ships GLib 2.40.