comparison audioDB-internals.h @ 591:0242e5d1643c

Address portability issues in database creation Define a getpagesize() macro which returns The Right Thing on WIN32 Use Windows permissions flags in open() with O_CREAT.
author mas01cr
date Tue, 11 Aug 2009 21:42:24 +0000
parents 4eedc18634f5
children cfa74bcc1249
comparison
equal deleted inserted replaced
590:4eedc18634f5 591:0242e5d1643c
2 #include <sys/locking.h> 2 #include <sys/locking.h>
3 #endif 3 #endif
4 #if !defined(WIN32) 4 #if !defined(WIN32)
5 #include <sys/mman.h> 5 #include <sys/mman.h>
6 #endif 6 #endif
7 #include <sys/stat.h>
7 #include <sys/types.h> 8 #include <sys/types.h>
8 9
9 #include <errno.h> 10 #include <errno.h>
10 #include <fcntl.h> 11 #include <fcntl.h>
11 #if defined(WIN32) 12 #if defined(WIN32)
353 #define ADB_FORMAT_VERSION (4U) 354 #define ADB_FORMAT_VERSION (4U)
354 355
355 #define align_up(x,w) (((x) + ((1<<w)-1)) & ~((1<<w)-1)) 356 #define align_up(x,w) (((x) + ((1<<w)-1)) & ~((1<<w)-1))
356 #define align_down(x,w) ((x) & ~((1<<w)-1)) 357 #define align_down(x,w) ((x) & ~((1<<w)-1))
357 358
359 #if defined(WIN32)
360 #define getpagesize() (64*1024)
361 #endif
362
358 #define align_page_up(x) (((x) + (getpagesize()-1)) & ~(getpagesize()-1)) 363 #define align_page_up(x) (((x) + (getpagesize()-1)) & ~(getpagesize()-1))
359 #define align_page_down(x) ((x) & ~(getpagesize()-1)) 364 #define align_page_down(x) ((x) & ~(getpagesize()-1))
360 365