GNOME Bugzilla – Bug 758691
g-ir-scanner doesn't "export" constants (macros) defined using other constants (macros) in some cases
Last modified: 2018-02-08 12:40:25 UTC
Created attachment 316289 [details] sources demonstrating the issue Description of problem: Best described with an example code: #define TEST_DATA_CONST1 10 #define TEST_DATA_CONST2 *10 #define TEST_DATA_CONST3 (TEST_DATA_CONST1 TEST_DATA_CONST2) If the above code is a part of the header file (attached) that is GI-introspected, only the TEST_DATA_CONST1 is "exported" (defined in the namespace). Version-Release number of selected component (if applicable): gobject-introspection-devel-1.42.0-1.fc21.x86_64 How reproducible: 100 % Steps to Reproduce: 1. use the test_data.c and test_data.h files to create a GI-introspected library 2. try to get the TEST_DATA_CONST3 e.g. from python $ gcc -fPIC -c -o test_data.o `pkg-config --cflags glib-2.0 gobject-2.0` test_data.c $ gcc -shared -o test_data.so `pkg-config --libs glib-2.0 gobject-2.0` test_data.o $ LD_LIBRARY_PATH=. g-ir-scanner `pkg-config --libs --cflags glib-2.0 gobject-2.0` --identifier-prefix=Test --symbol-prefix=test --namespace Test --nsversion=1.0 --library test_data --warn-all -o Test-1.0.gir test_data.c test_data.h $ g-ir-compiler Test-1.0.gir > Test-1.0.typelib $ GI_TYPELIB_PATH=. LD_LIBRARY_PATH=. ipython Actual results: no TestData.CONST3 in the TestData module/namespace Expected results: TestData.CONST3 in the TestData module/namespace as it is a valid constant and preprocessor expands it to the right value just fine
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/152.