View Single Post
Old 14 October 2018, 14:09   #11
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by Leffmann View Post
Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

char* get_workdir(void) {
  static char dir[MAX_PATH];
  GetCurrentDirectoryA(MAX_PATH, dir);
  return dir;
}
Great! I could only hope it was so easy. Now, when clenched could confirm that it works the same with MinGW/gcc, then I take it!

Quote:
Originally Posted by plasmab View Post
I'll happily beta test this stuff. I use vbcc and vasm as part of my toolchain for the TF cards.
Thanks. I have just committed an update, which should be available with tomorrow's (UTC) snapshot. For the moment I'm using _getcwd(), which the author of "Virtual Jaguar" (who is working on DWARF support in his debugger) has confirmed working, but I would like to replace it.

Quote:
@phx you should have my email address in your inbox from my bug reports in the past.
Probably. Although you were most likely using your real name, which I don't remember, and not "plasmab" - so it's not that easy.

Quote:
Originally Posted by clenched View Post
I know first hand anything needing windows.h will cause these conflicts when building VASM.
Arrrgh! I just restructured the source, because Atari's tos.h also defines ERROR, but there is so much more!

@Leffmann: Can you confirm those conflicts? Or doesn't MSVC warn about it (which wouldn't surprise me)? Or maybe those are different windows.h, depending on the compiler used?

Quote:
It's not clear what is wrong with getcwd.
It's from a linker-library and not an OS function, so I fear it is not portable between different Windows compilers (like _getcwd(), which works with MSVC).

Quote:
Is it to find path a.exe was ran from or where a.exe lives on drive?
As the name implies, I want to find the current work directory, i.e. the current directory you are in, when starting the assembler. This absolute path is needed in the DWARF compilation unit, so a DWARF-consumer can find your sources for source-level debugging.

Quote:
MAXPATHLEN clashes somewhere when compiled into VASM.
That's why I didn't include <sys/param.h> in my Unix-version of get_workdir(), but use the vasm MAXPATHLEN instead.
phx is offline  
 
Page generated in 0.04485 seconds with 11 queries