Git Product home page Git Product logo

Comments (8)

ZipCPU avatar ZipCPU commented on June 19, 2024

You realize, I could apply this patch but I won't be able to test it.

Let me just ask, is it working for you?

Dan

from dblclockfft.

ZipCPU avatar ZipCPU commented on June 19, 2024

Try the core generator now. As far as I can tell, this should (now) be fixed.

Dan

from dblclockfft.

mcleinn avatar mcleinn commented on June 19, 2024

Sorry, it does not work for me like that. The current code produces a lot of errors, and it does not seem to go into the IF clause at all. However, the code compiles when I remove the #elif defined(__MINGW32__) clause, and put the code

#ifdef __MINGW32__
#include <direct.h> // mkdir
#define mkdir(A,B)  _mkdir(A)
#define lstat(p,s)   stat(p,s)
#endif

before the #ifdef _MSC_VER in line 67

Please note that there is a comment about "Macintosh environment" in your code.
If this refers to MINGW-w64/MSYS2, this would not be correct. MINGW-w64/MSYS2 is a Unix-style open source development platform for Windows, which is popular with the open hardware crowd.

To answer to your first question, yes, adding this code removes all issues and lets me run the generator.

from dblclockfft.

ZipCPU avatar ZipCPU commented on June 19, 2024

This isn't for the Mac? My bad then.

If the "elif" isn't getting acted on, then is the prior "ifdef" what's getting run or the one following? If the one following, then ... is that because the "__MINGW32__" macro I used isn't defined?

The reason why I rewrote the code from what you gave me is because I needed to. I've now got three separate operating environments, all different, all of which need to be supported, and no two of which should ever be true together. Hence the need for the 3-way "if" statement.

Would it work if the "ifdef _MSC_VER" was adjusted to "#if defined(_MSC_VER)"? That should be valid C preprocessor syntax--although what's there should be valid syntax too. I'd be quite curious to know why it isn't running for you.

Dan

from dblclockfft.

mcleinn avatar mcleinn commented on June 19, 2024

Turns out the problem is not with the preprocessor syntax.
The problem is that MINGW is a Linux-style environment, and it requires the includes you included for Linux in the "#else" part.
The following compiles:

#elif defined(__MINGW32__) 
// MinGW - Minimalist GNU for Windows - also MinGW-w64/MSYS2
// {{{
#include <direct.h>	// mkdir
#define	mkdir(A,B)	_mkdir(A)
#define	lstat(p,s)	stat(p,s)
#include <unistd.h>	// Defines the R_OK/W_OK/etc. macros
#include <sys/stat.h>
// }}}
#else

from dblclockfft.

ZipCPU avatar ZipCPU commented on June 19, 2024

Ok, patched. Please give it a test and tell me if it works. (It should ...)

Dan

from dblclockfft.

mcleinn avatar mcleinn commented on June 19, 2024

Yes, I can confirm that the current version compiles without problems. Thank you

from dblclockfft.

ZipCPU avatar ZipCPU commented on June 19, 2024

Awesome! Thank you for your help. I'm sure others using MinGW thank you as well.

Closing this issue.

Dan

from dblclockfft.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.