Browse Source

More windows fixes

- Designated initializer don't work in C++ code for MSVC

- munmap signature moved to the header
cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
cdd749e3c6
  1. 2
      ethash.h
  2. 1
      mmap.h
  3. 2
      mmap_win32.c

2
ethash.h

@ -73,7 +73,7 @@ static inline void ethash_h256_reset(ethash_h256_t *hash)
// have to provide all 32 values. If you don't provide all the rest
// will simply be unitialized (not guranteed to be 0)
#define ethash_h256_static_init(...) \
{.b = {__VA_ARGS__} }
{ {__VA_ARGS__} }
struct ethash_light;
typedef struct ethash_light* ethash_light_t;

1
mmap.h

@ -39,6 +39,7 @@
#define MAP_FAILED ((void *) -1)
void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
void munmap(void *addr, size_t length);
#else // posix, yay! ^_^
#include <sys/mman.h>
#endif

2
mmap_win32.c

@ -74,7 +74,7 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset
return ret;
}
static void munmap(void *addr, size_t length)
void munmap(void *addr, size_t length)
{
UnmapViewOfFile(addr);
/* ruh-ro, we leaked handle from CreateFileMapping() ... */

Loading…
Cancel
Save