Skip to content

Commit

Permalink
Not everyone wants to put underscores before POSIX C library function…
Browse files Browse the repository at this point in the history
…s, Microsoft. Especially when it makes the code fail to compile on non-Windows platforms.
  • Loading branch information
joncampbell123 committed Sep 26, 2023
1 parent 251cacb commit b3e0973
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dos/dos_programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ FILE *testLoadLangFile(const char *fname);
Bitu DEBUG_EnableDebugger(void);
#endif

/* Microsoft likes to make POSIX library functions less convenient and your code
* less portable by nagging you to add a leading underscore to those functions. */
#if !defined(_MSC_VER)
#define _access access
#define _strdup strdup
#endif

class MOUSE : public Program {
public:
void Run(void);
Expand Down Expand Up @@ -7809,7 +7816,7 @@ uint64_t VHDMAKE::ssizetou64(const char* s_size) {
char* c;
uint64_t size;

if((c = strchr(sizes, toupper(*last)))) {
if((c = strchr((char*)sizes, toupper(*last)))) {
*last = 0;
size = atoll(sd_size);
size <<= ((c - sizes) * 10);
Expand Down

0 comments on commit b3e0973

Please sign in to comment.