Make simple_mmap and simple_unmmap static private members of SGMMapFile. This should also fix the Windows build error on Jenkins.

This commit is contained in:
Erik Hofman
2021-03-15 14:45:52 +01:00
parent c539f7ebb6
commit 88beb40090
2 changed files with 13 additions and 14 deletions

View File

@@ -46,18 +46,6 @@
#include "sg_mmap.hxx"
#ifdef WIN32
/*
* map 'filename' and return a pointer to it.
*/
static void *simple_mmap(int, size_t, SIMPLE_UNMMAP *);
static void simple_unmmap(void*, size_t, SIMPLE_UNMMAP *);
#else
# define simple_mmap(a, b, c) mmap(0, (b), PROT_READ, MAP_PRIVATE, (a), 0L)
# define simple_unmmap(a, b, c) munmap((a), (b))
#endif
SGMMapFile::SGMMapFile( )
{
set_type( sgFileType );
@@ -304,7 +292,7 @@ bool SGMMapFile::close() {
*/
void *
simple_mmap(int fd, size_t length, SIMPLE_UNMMAP *un)
SGMMapFile::simple_mmap(int fd, size_t length, SIMPLE_UNMMAP *un)
{
HANDLE f;
HANDLE m;
@@ -333,7 +321,7 @@ simple_mmap(int fd, size_t length, SIMPLE_UNMMAP *un)
}
void
simple_unmmap(void *addr, size_t len, SIMPLE_UNMMAP *un)
SGMMapFile::simple_unmmap(void *addr, size_t len, SIMPLE_UNMMAP *un)
{
UnmapViewOfFile(un->p);
CloseHandle(un->m);

View File

@@ -63,6 +63,17 @@ class SGMMapFile : public SGIOChannel {
int un; // referenced but not used
#endif
#ifdef WIN32
/*
* map 'filename' and return a pointer to it.
*/
static void *simple_mmap(int, size_t, SIMPLE_UNMMAP *);
static void simple_unmmap(void*, size_t, IMPLE_UNMMAP *);
#else
# define simple_mmap(a, b, c) mmap(0, (b), PROT_READ, MAP_PRIVATE, (a), 0L)
# define simple_unmmap(a, b, c) munmap((a), (b))
#endif
public:
SGMMapFile();