[CM] s7_complex does not compile for MSVC
Da Shen
da at liii.pro
Wed Nov 20 22:29:33 PST 2024
> Thanks! All those references are interesting (and depressing).
Programming on Windows is depressing indeed.
I found that IO routines (eg. call-with-input-file, call-with-output-file) in S7 Scheme does not support unicode path while it works on windows.
It means if a user's name is in unicode, S7 Scheme will not work properly on Windows. Because the path on Windows would be: C:/Users/[Username]/Documents/xxx.scm
Goldfish Scheme add tbox as a dependency to solve the problem of cross platform without dive into the boring Windows API.
https://github.com/tboox/tbox <https://github.com/tboox/tbox >
There are three reason why I choose tbox to add glue routines to S7 Scheme for Goldfish Scheme:
1. cross platform (Linux/macOS/Windows)
2. zero dependency
3. almost available everywhere because xmake is almost available everywhere
> I think there might be a typo in the patch you sent: _MSC_V
Yes. Your correction is correct. Sorry that I have not generate the patch by the diff command line tool.
Why not host S7 on Github, and setup continuous integration in Linux, Windows, macOS using different compilers?
In this way, community developers can create pull request much more easier.
------------------------------------------------------------------
From:bil <bil at ccrma.Stanford.EDU>
Send Time:2024 Nov. 21 (Thu.) 03:38
To:"沈达"<da at liii.pro>
Cc:cmdist<cmdist at ccrma.Stanford.EDU>
Subject:Re: [CM] s7_complex does not compile for MSVC
Thanks! All those references are interesting (and depressing).
I think there might be a typo in the patch you sent: _MSC_V
for _MSC_VER? Here's my current guess (with 2 clang++ cases so
I can switch back and forth more easily):
#if __TINYC__ || _MSC_VER || (__clang__ && __cplusplus)
/* _MSC_VER (and clang++??) should also set HAVE_COMPLEX_NUMBERS to 0
*/
typedef double s7_complex;
#else
#if __cplusplus /* only __GNUC__ */
#include <complex>
#ifdef __GNUC__
typedef std::complex<s7_double> s7_complex;
#else
using s7_complex = std::complex<double>;
/* sort of works in clang++ but there are many more problems */
#endif
#else
#include <complex.h>
typedef double complex s7_complex;
#endif
#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20241121/93f117e5/attachment.html>
More information about the Cmdist
mailing list