mirror of
https://github.com/fltk/fltk.git
synced 2026-05-29 04:26:27 +08:00
Remove '#include <sys/stat.h>' from FL/platform_types.h
- Add this include statement only where needed. - Rename Fl_System_Driver::stat() to flstat(). This fixes an issue when using some (!) MinGW 64-bit build systems that obviously '#define stat _stat64' or similar. This would result in compiler problems if 'stat()' is a member function of Fl_System_Driver.
This commit is contained in:
+2
-1
@@ -29,7 +29,8 @@
|
|||||||
|
|
||||||
#include "Fl_Export.H"
|
#include "Fl_Export.H"
|
||||||
#include "fl_types.h"
|
#include "fl_types.h"
|
||||||
#include <stdio.h> // FILE *fl_fopen()
|
#include <stdio.h> // FILE *fl_fopen()
|
||||||
|
#include <sys/stat.h> // struct stat
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ typedef int FL_SOCKET;
|
|||||||
typedef class NSOpenGLContext* GLContext;
|
typedef class NSOpenGLContext* GLContext;
|
||||||
#endif /* __OBJC__ */
|
#endif /* __OBJC__ */
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
# define FL_COMMAND FL_META
|
# define FL_COMMAND FL_META
|
||||||
@@ -106,7 +105,6 @@ typedef unsigned __int64 FL_SOCKET; /* *FIXME* - FL_SOCKET (see above) */
|
|||||||
typedef int FL_SOCKET;
|
typedef int FL_SOCKET;
|
||||||
# endif
|
# endif
|
||||||
typedef struct HGLRC__ *GLContext;
|
typedef struct HGLRC__ *GLContext;
|
||||||
#include <sys/stat.h>
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
#else
|
#else
|
||||||
@@ -119,7 +117,6 @@ typedef struct flCairoRegion* Fl_Region;
|
|||||||
typedef int FL_SOCKET; /**< socket or file descriptor */
|
typedef int FL_SOCKET; /**< socket or file descriptor */
|
||||||
typedef void *EGLContext;
|
typedef void *EGLContext;
|
||||||
typedef EGLContext GLContext;
|
typedef EGLContext GLContext;
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
@@ -129,7 +126,6 @@ typedef unsigned long Fl_Offscreen;
|
|||||||
typedef struct _XRegion *Fl_Region;
|
typedef struct _XRegion *Fl_Region;
|
||||||
typedef int FL_SOCKET;
|
typedef int FL_SOCKET;
|
||||||
typedef struct __GLXcontextRec *GLContext;
|
typedef struct __GLXcontextRec *GLContext;
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public:
|
|||||||
virtual int execvp(const char * /*file*/, char *const * /*argv*/) {return -1;}
|
virtual int execvp(const char * /*file*/, char *const * /*argv*/) {return -1;}
|
||||||
virtual int chmod(const char* /*f*/, int /*mode*/) {return -1;}
|
virtual int chmod(const char* /*f*/, int /*mode*/) {return -1;}
|
||||||
virtual int access(const char* /*f*/, int /*mode*/) { return -1;}
|
virtual int access(const char* /*f*/, int /*mode*/) { return -1;}
|
||||||
virtual int stat(const char* /*f*/, struct stat *) { return -1;}
|
virtual int flstat(const char* /*f*/, struct stat *) { return -1;}
|
||||||
virtual char *getcwd(char* /*b*/, int /*l*/) {return NULL;}
|
virtual char *getcwd(char* /*b*/, int /*l*/) {return NULL;}
|
||||||
virtual int chdir(const char*) {return -1;}
|
virtual int chdir(const char*) {return -1;}
|
||||||
virtual int unlink(const char*) {return -1;}
|
virtual int unlink(const char*) {return -1;}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
virtual int execvp(const char *file, char *const *argv);
|
virtual int execvp(const char *file, char *const *argv);
|
||||||
virtual int chmod(const char *fnam, int mode);
|
virtual int chmod(const char *fnam, int mode);
|
||||||
virtual int access(const char *fnam, int mode);
|
virtual int access(const char *fnam, int mode);
|
||||||
virtual int stat(const char *fnam, struct stat *b);
|
virtual int flstat(const char *fnam, struct stat *b);
|
||||||
virtual char *getcwd(char *b, int l);
|
virtual char *getcwd(char *b, int l);
|
||||||
virtual int chdir(const char *path);
|
virtual int chdir(const char *path);
|
||||||
virtual int unlink(const char *fnam);
|
virtual int unlink(const char *fnam);
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ int Fl_WinAPI_System_Driver::access(const char *fnam, int mode) {
|
|||||||
return _waccess(utf8_to_wchar(fnam, wbuf), mode);
|
return _waccess(utf8_to_wchar(fnam, wbuf), mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Fl_WinAPI_System_Driver::stat(const char *fnam, struct stat *b) {
|
int Fl_WinAPI_System_Driver::flstat(const char *fnam, struct stat *b) {
|
||||||
|
|
||||||
// remove trailing '/' or '\'
|
// remove trailing '/' or '\'
|
||||||
unsigned len = (unsigned)strlen(fnam);
|
unsigned len = (unsigned)strlen(fnam);
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Author: Jean-Marc Lienher ( http://oksid.ch )
|
// Author: Jean-Marc Lienher ( http://oksid.ch )
|
||||||
// Copyright 2000-2010 by O'ksi'D.
|
// Copyright 2000-2010 by O'ksi'D.
|
||||||
// Copyright 2016-2020 by Bill Spitzak and others.
|
// Copyright 2016-2022 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@@ -462,7 +462,7 @@ int fl_access(const char* f, int mode) {
|
|||||||
\return the return value of _wstat() on Windows or stat() on other platforms.
|
\return the return value of _wstat() on Windows or stat() on other platforms.
|
||||||
*/
|
*/
|
||||||
int fl_stat(const char* f, struct stat *b) {
|
int fl_stat(const char* f, struct stat *b) {
|
||||||
return Fl::system_driver()->stat(f, b);
|
return Fl::system_driver()->flstat(f, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cross-platform function to change the current working directory,
|
/** Cross-platform function to change the current working directory,
|
||||||
|
|||||||
Reference in New Issue
Block a user