-
Notifications
You must be signed in to change notification settings - Fork 105
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
2 problems with global constants. #1291
Comments
For referene :
|
Additionnally, I would add
with project.prefix = "FBP" :
But ... this would break existing projects ... |
stephan57160
added a commit
to stephan57160/zproject
that referenced
this issue
Aug 1, 2022
Project constant definition: ``` <constant name = "global constant stuff" value = "123" type = "string" > this is a multi-line comment for global constant </constant> ``` Generated header file: ``` make[1]: Entering directory `/home/cbox_dev/git/zproject-issues-testing' CC src/src_libfbp_la-foo.lo In file included from src/../include/libfoobar.h:18:0, from src/fbp_classes.h:35, from src/foo.c:21: src/../include/fbp_library.h:95:5: error: unknown type name 'this' this is a ^ src/../include/fbp_library.h:95:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' this is a ^ ... ``` See zeromq#1291 for more details. Solution: Apply a similar fix than zeromq#1283, but on global constants. ``` // this is a // multi-line comment // for global constant ``` Additionnally, a few blank lines are added to separate the constants definitions, from each other. Note: to look like the project version constants: ``` ``` This particular modification is not applied with this PR
stephan57160
added a commit
to stephan57160/zproject
that referenced
this issue
Aug 1, 2022
Project constant definition: ``` <constant name = "global constant stuff" value = "123" type = "string" > this is a multi-line comment for global constant </constant> ``` Generated header file: ``` this is a multi-line comment for global constant ``` Compilation failure: ``` make[1]: Entering directory `/home/cbox_dev/git/zproject-issues-testing' CC src/src_libfbp_la-foo.lo In file included from src/../include/libfoobar.h:18:0, from src/fbp_classes.h:35, from src/foo.c:21: src/../include/fbp_library.h:95:5: error: unknown type name 'this' this is a ^ src/../include/fbp_library.h:95:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' this is a ^ ... ``` See zeromq#1291 for more details. Solution: Apply a similar fix than zeromq#1283, but on global constants. ``` // this is a // multi-line comment // for global constant this is a multi-line comment for global constant ``` Additionnally, a few blank lines are added to separate the constants definitions, from each other. Note: `$(PROJECT.PREFIX:c)_` to look like the project version constants: ``` ``` This particular modification is not applied with this PR
stephan57160
added a commit
to stephan57160/zproject
that referenced
this issue
Aug 1, 2022
Project constant definition: ``` <constant name = "global constant stuff" value = "123" type = "string" > this is a multi-line comment for global constant </constant> ``` Generated header file: ``` this is a multi-line comment for global constant ``` Compilation failure: ``` make[1]: Entering directory `/home/cbox_dev/git/zproject-issues-testing' CC src/src_libfbp_la-foo.lo In file included from src/../include/libfoobar.h:18:0, from src/fbp_classes.h:35, from src/foo.c:21: src/../include/fbp_library.h:95:5: error: unknown type name 'this' this is a ^ src/../include/fbp_library.h:95:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' this is a ^ ... ``` See zeromq#1291 for more details. Solution: Apply a similar fix than zeromq#1283, but on global constants. ``` // this is a // multi-line comment // for global constant ``` Additionnally, a few blank lines are added to separate the constants definitions, from each other. Note: Global constants should be prefixed with `$(PROJECT.PREFIX:c)_`, like for version constants, but this is not applied here.
Closing, as PR is accepted. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem: global constants name and descriptions are buggy, compared to per-class constants.
Solution: Fix generated global constant names and their description.
$(CONSTANT.NAME:c)
instead of$(CONSTANT.NAME)
inzproject_class.gls
.Example:
Extract of
project.xml
:Generated file:
As a consequence, C compilation fails:
I know it's not the rule, but as both fixes are really close, would you accept a single PR for both ?
The text was updated successfully, but these errors were encountered: