Skip to content

Commit

Permalink
Merge pull request #10 from ribtoks/master
Browse files Browse the repository at this point in the history
Improvement for shared library build
  • Loading branch information
witwall authored Nov 24, 2017
2 parents 9dbdb64 + 712e045 commit f5ff813
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
13 changes: 13 additions & 0 deletions mman-win32.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
QT -= core gui

TARGET = mman
TEMPLATE = lib
# CONFIG += staticlib

DEFINES += MMAN_LIBRARY

HEADERS += \
mman.h

SOURCES += \
mman.c
18 changes: 12 additions & 6 deletions mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
#include <_mingw.h>
#endif

#if defined(MMAN_LIBRARY)
#define MMANSHARED_EXPORT __declspec(dllexport)
#else
#define MMANSHARED_EXPORT __declspec(dllimport)
#endif

/* Determine offset type */
#include <stdint.h>
#if defined(_WIN64)
Expand Down Expand Up @@ -49,12 +55,12 @@ extern "C" {
#define MS_SYNC 2
#define MS_INVALIDATE 4

void* mmap(void *addr, size_t len, int prot, int flags, int fildes, OffsetType off);
int munmap(void *addr, size_t len);
int _mprotect(void *addr, size_t len, int prot);
int msync(void *addr, size_t len, int flags);
int mlock(const void *addr, size_t len);
int munlock(const void *addr, size_t len);
MMANSHARED_EXPORT void* mmap(void *addr, size_t len, int prot, int flags, int fildes, OffsetType off);
MMANSHARED_EXPORT int munmap(void *addr, size_t len);
MMANSHARED_EXPORT int _mprotect(void *addr, size_t len, int prot);
MMANSHARED_EXPORT int msync(void *addr, size_t len, int flags);
MMANSHARED_EXPORT int mlock(const void *addr, size_t len);
MMANSHARED_EXPORT int munlock(const void *addr, size_t len);

#ifdef __cplusplus
}
Expand Down

0 comments on commit f5ff813

Please sign in to comment.