-
Notifications
You must be signed in to change notification settings - Fork 15
Improved zerobufCxx.py for ipp files generation #84
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
Conversation
|
Can one of the admins verify this patch? |
bin/zerobufCxx.py
Outdated
| (classname + '::') if classname else '', impl_function)) | ||
| else: | ||
| file.write('inline {0} {1}{2}\n{{'.format(self.ret_val, | ||
| (classname + '::') if classname else '', impl_function)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid code repetition, add inline as an additional format parameter and use a variable which can be empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with a new parameter on format string.
|
looks OK to me, but we have to remove shallow = true from .gitmodules to make CI pass |
|
Can one of the admins verify this patch? |
|
We've getting some errors making the compilation with cpp files with 'inline' keyword. To solve that, 'inline' keyword only is used on inline implementations (ipp files). |
rdumusc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. Please rebase your PR on #85 to fix the CI build, which is needed for merging.
bin/zerobufCxx.py
Outdated
| import sys | ||
| from collections import namedtuple, OrderedDict | ||
|
|
||
| inline_implementation = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there is a good reason for this global "option" I would remove it and always add inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it won't work. In Linux these functions are not inline and I would not force the use of inline functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check 7ab0058; there is already enough code to decide if to use inline on Windows, and not-inline everywhere else. I wonder why I forgot the inline back then, it seemed to have worked, but that's obviously not working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed global default value of inline_implementation and global keyword. Only needed read access to variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rdumusc , review this change, please. Thanks.
…l keyword to only read access.
bin/zerobufCxx.py
Outdated
| (classname + '::') if classname else '', impl_function)) | ||
| add_before_inline = "" | ||
| add_after_inline = "" | ||
| if inline_implementation is True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to compare against 'True'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, I forgot to remove it. Now it's fixed. Thanks.
dnachbaur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good otherwise. Thx for the fix!
|
retest this please |
Hello, I'm Gonzalo Bayo, from the group working back in URJC/UPM with Pablo Toharia. Right now I'm trying to use ZeroBuf in a custom C++ project in Windows and the generated ipp files don't compile if we use this library in more than one project. Visual Studio compiler reject the compilation with an LNK2005( function/method already defined ).
Modifying the zerobufCxx.py file by adding the "inline" keyword before function definitions on ipp files could be an option to fix this and make errors disappear.
Regards