mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 06:30:16 +00:00
Fixed Visual C++ build (and some style adjustments).
This commit is contained in:
parent
250e4ed9e0
commit
3598fb505d
@ -2,7 +2,7 @@
|
||||
/* */
|
||||
/* stat.h */
|
||||
/* */
|
||||
/* Constants for the mode argument of open */
|
||||
/* Constants for the mode argument of open and creat */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
@ -44,10 +44,9 @@
|
||||
|
||||
|
||||
|
||||
/* Must match the values in src/sim65/paravirt.c */
|
||||
#define S_IREAD 0x01
|
||||
#define S_IWRITE 0x02
|
||||
|
||||
#define S_IREAD 0x1
|
||||
#define S_IWRITE 0x2
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(_WIN32)
|
||||
# define O_INITIAL O_BINARY
|
||||
@ -51,18 +50,10 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifndef S_IREAD
|
||||
# ifdef _WIN32
|
||||
# define S_IREAD _S_IREAD
|
||||
# else
|
||||
# define S_IREAD S_IRUSR
|
||||
# endif
|
||||
# define S_IREAD S_IRUSR
|
||||
#endif
|
||||
#ifndef S_IWRITE
|
||||
# ifdef _WIN32
|
||||
# define S_IWRITE _S_IWRITE
|
||||
# else
|
||||
# define S_IWRITE S_IWUSR
|
||||
# endif
|
||||
# define S_IWRITE S_IWUSR
|
||||
#endif
|
||||
|
||||
/* common */
|
||||
@ -185,18 +176,18 @@ static void PVOpen (CPURegs* Regs)
|
||||
{
|
||||
char Path[1024];
|
||||
int OFlag = O_INITIAL;
|
||||
int OMode = 0;
|
||||
unsigned RetVal, I = 0;
|
||||
mode_t OMode = 0;
|
||||
|
||||
unsigned Mode = PopParam (Regs->YR - 4);
|
||||
unsigned Flags = PopParam (2);
|
||||
unsigned Name = PopParam (2);
|
||||
|
||||
if (Regs->YR - 4 < 2) {
|
||||
/* If the caller did not supply the mode argument,
|
||||
** use a reasonable default.
|
||||
/* If the caller didn't supply the mode
|
||||
** argument, use a reasonable default.
|
||||
*/
|
||||
Mode = 0x1 | 0x2;
|
||||
Mode = 0x01 | 0x02;
|
||||
}
|
||||
|
||||
do {
|
||||
@ -230,10 +221,10 @@ static void PVOpen (CPURegs* Regs)
|
||||
OFlag |= O_EXCL;
|
||||
}
|
||||
|
||||
if (Mode & 0x1) {
|
||||
if (Mode & 0x01) {
|
||||
OMode |= S_IREAD;
|
||||
}
|
||||
if (Mode & 0x2) {
|
||||
if (Mode & 0x02) {
|
||||
OMode |= S_IWRITE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user