Skip to content

Conversation

@kou
Copy link
Member

@kou kou commented Sep 17, 2017

Ubuntu 14.04 ships GLib 2.40.

Copy link
Member

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

Copy link
Member Author

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

#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.

Copy link
Member

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

Copy link
Member Author

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!

@wesm
Copy link
Member

wesm commented Sep 17, 2017

Can you also rebase on master?

Ubuntu 14.04 ships GLib 2.40.
@kou kou force-pushed the glib-support-glib-2.40-again branch from daadd3f to cbcdf9a Compare September 17, 2017 21:13
@kou
Copy link
Member Author

kou commented Sep 17, 2017

Done.
I think that C++ failure https://travis-ci.org/apache/arrow/jobs/276617308 isn't related this change.

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@asfgit asfgit closed this in bfe6579 Sep 17, 2017
@kou kou deleted the glib-support-glib-2.40-again branch September 17, 2017 22:40
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

Successfully merging this pull request may close these issues.

2 participants