-
Couldn't load subscription status.
- Fork 196
Modularized bitsets #1049
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
base: master
Are you sure you want to change the base?
Modularized bitsets #1049
Conversation
|
I would have say to better rely on C-preprocessing and passing a flag definition |
I agree, but I could not find a backward-compatible approach with C-preprocessing. However, with cpp, something like Any other suggestions? |
|
Here is an idea: #ifdef STDLIB_WITH_BITSET
#define WITH_BITSET 1
#else
#define WITH_BITSET 0
#endifThis file can be included elsewhere with |
Thank you. I tried with this strategy, but then I was challenged with the #:for k1, t1 in IRB_KIND_TYPES
module procedure :: swap_${k1}$
#:endforWith An ugly (at least for me) solution could be: #:for k1, t1 in IRB_KIND_TYPES
#:if 'bitset' in t1
#ifdef WITH_BITSET
#:endif
module procedure :: swap_${k1}$
#:if 'bitset' in t1
#end
#:endif
#:endforI have the feeling that such an approach will result in a code even more difficult to follow and maintain. All suggestions are welcome. |
|
I tried to give it some more thoughts but indeed I can't think of a more elegant way of handling this. Your solution is very good, just wanted to check if we could rely on c-preprocessing which is much more standard. In any case, I would say, given that both GNU and Intel compilers can handle all the features and are the most common compilers, to keep it activated by default and let users remove it with fypp for other compilers which can't compile these modules. I would like to keep the idea of a macro header file open for future ideas though, I think it might facilitate many future hurdles. |
Based on #1031, #1033
Here is a proposition to modularize
stdlib_bitsetsincmake.Furthermore, compiling
stdlib_bitsetscan be now set off withcmake\cc: @eduardz1 @jalvesz @perazz