Conversation
|
This may be a stupid question since my C is extremely rusty, but doesn't this change require changing
to
or is 1 (here as shortint) automatically mapped to True and 0 to False in C? |
|
Am 17.07.2015 um 20:40 schrieb Frank Noe:
|
|
actually it is the other way around...
|
…catch calls to c99 functions, which are not available in MSVC.
92ba0e7 to
a2e6c4b
Compare
|
this was a hard one. Finally it is fixed. |
|
Thanks a lot. But: Oh my god. Is it really that complicated? Is there no platform-independent way to check for infs or compute a min? Hard to believe. Can we at least encapsulate these platform-dependent functions in separate functions and do the case switch in there? I don't to have them in the main code. |
|
Am 22.07.2015 um 19:55 schrieb Frank Noe:
|
|
OK, let me have a look. Am 22/07/15 um 19:59 schrieb Martin K. Scherer:
Prof. Dr. Frank Noe Phone: (+49) (0)30 838 75354 Mail: Arnimallee 6, 14195 Berlin, Germany |
|
C++ is your friend. If you want to support windows, C (C89) is essentially unusable. You could work around a lot of this with macros, but it's a loosing battle. |
|
Thanks for the hint. I would much prefer to use C++ anyway. |
|
Its not about writing code in C++, but compiling the C code with the win
C++ compiler (which is also pretty ugly).
|
|
But then, why don't we just use the C++ compiler on Windows? |
|
C++ is essentially a super set of C, so "writing C++" is really only as different as you want it to be. You can also just use the C++ on *nix too. MDTraj still uses a lot of C, but all of that was written before I realized the /better way/. |
|
adding language='c++' to the extension and file extension cpp seems to
work (in the sense, the M$ c++ compiler is invoked).
|
|
Would this avoid the precompiler macros? |
|
@marscher, I don't think these two lines can be equivalent Since in the first one, one checks for finite, and in the second one for infinite. I suggest reverting this PR and finding a clean solution together with @trendelkampschroer tomorrow. Both his and my modules are affected, but I am essentially knocked out with meetings all day. |
|
I think renaming the function !_finite into _isinf, if possible would make things easier to read. @marscher: Let's have a look at it today. Thanks for digging deep into the internals of the microsoft implementation of the C-standard library and coming up with a method to make this module compile also on Windows machines. |
|
Thanks! That one is not just about readability - the expression !_finite should translate to We definitely need stronger tests testing the result of a sampling. This For readability and clarity of the code it would be good to redefine Am 23/07/15 um 09:26 schrieb Benjamin Trendelkamp-Schroer:
Prof. Dr. Frank Noe Phone: (+49) (0)30 838 75354 Mail: Arnimallee 6, 14195 Berlin, Germany |
…functions to util.h and re-use them.
[tmatrix-sampling] follow up fix for PR #33.
No description provided.