Closed sonoro1234 closed 5 years ago
I am testing https://github.com/sonoro1234/cimgui/tree/GlyphRanges only cimgui.cpp and cimgui.h manually edited _init and _create version work for ImVector_ImWchar I still dont know which is better
Updated cimgui for exposing constructors and destructor except for ImVector where only ImVector_Wchar was manually written to test GlyphRangesBuilder
Added ImVector template C structs
This looks very promising, but right now the cimgui.h
is unusable with C compilers due to compiler errors:
test.c:
#include <cimgui.h>
$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ gcc -std=c99 -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS=1 -I. test.c
In file included from test.c:1:0:
./cimgui.h:591:60: error: ‘ImVector_float’ redeclared as different kind of symbol
struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float;
^~~~~~~~~~~~~~
In file included from test.c:1:0:
./cimgui.h:66:31: note: previous declaration of ‘ImVector_float’ was here
typedef struct ImVector_float ImVector_float;
^~~~~~~~~~~~~~
... a lot of errors involving various ImVector types
$ clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ clang -std=c99 -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS=1 -I. test.c
./cimgui.h:591:60: error: redefinition of 'ImVector_float' as different kind of symbol
struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float;
^
./cimgui.h:66:31: note: previous definition is here
typedef struct ImVector_float ImVector_float;
... a lot of errors involving various ImVector types
@Gekkio Just pushed correction. Is it ok now?
I need your feedback because it was compiling ok for me before
It was without DCIMGUI_DEFINE_ENUMS_AND_STRUCTS
Thanks for the quick fix! Works perfectly now :smile:
I am most interested in ImVector use cases. Has anybody been able to use an ImVector not just reading from it but also creating an ImVector before using it?
Also, to really expose it as a C interface we should define several new structs as for example