get_instance_private() is not a macro, and it’s not added by
G_ADD_PRIVATE. The whole instance private data handling is generated by
G_DEFINE_TYPE_EXTENDED, which is what
G_ADD_PRIVATE only tells GType to reserve the size of the instance private data when creating an instance.
G_DEFINE_TYPE_EXTENDED macro defines the static, global variable that contains the offset for the instance private data from the instance pointer; you cannot access that from outside the compilation unit, and you cannot expose the
static inline function.
Of course, you could reimplement this whole machinery by yourself: you just need to do what
G_DEFINE_TYPE_EXTENDED does. It’s all public API, anyway. Nevertheless, what you want to achieve is simply not possible within the constraints of the code generated by the GObject macros—and it’s not possible for a reason.
My strong suggestion is to not give out the whole instance private data across compilation unit; use specific accessor functions for the data you need; it’ll make refactoring easier, and it’ll keep your code cleaner.