Skip to content
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

Fix for MSVC #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix for MSVC #4

wants to merge 1 commit into from

Conversation

SzateX
Copy link

@SzateX SzateX commented Feb 7, 2022

I have found that runtime library is unable to compile under MSVC compiler. List of fix is shown below:

  • in tools.c I have changed way to init empty structure, to be compatible with C standard. In C17 there is no possiblity to put empty initialization list according to this (it looks that C23 will add this, but MSVC is not compatible with this standard).

  • in format.c I put definition of PATH_MAX which is only declared in linux/limits.h on Linux. I set value to 4096.

  • in utilities.c I also put definition of PATH_MAX (probably it could be better place for it).

  • in utilities.c was a problem with unistd.h which not exists on systems without posix. Currently I'm checking macro _MSC_VER, and if it exists I'm including <direct.h>. It contains _getcwd function which I rename to getcwd.

  • in utitilities.c there was also problem with initialization of array in vUtilCurrentWorkingDirectory function. C language not allows to put consts as element number (it will be added in C23). Currently I change s_uiBufSize to macro.

I hope this changes will help to make runtime library more portable.

@ldthomas
Copy link
Owner

It's been over two years since I have done any work on this project or any work in the C language for that matter. At this point I have no plans to resurrect my C-development environment and make any changes. With the BSD license you are, of course, free to modify it anyway you wish for your own projects.

Thanks for using APG 7.0 and good luck with your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants