declare smobs in alloc.c
[bpt/emacs.git] / src / w32common.h
CommitLineData
501199a3 1/* Common functions for Microsoft Windows builds of Emacs
ba318903 2 Copyright (C) 2012-2014 Free Software Foundation, Inc.
501199a3
DC
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef W32COMMON_H
22#define W32COMMON_H
23
24#include <windows.h>
25
26#define ROUND_UP(p, align) (((DWORD_PTR)(p) + (align)-1) & ~((DWORD_PTR)(align)-1))
27#define ROUND_DOWN(p, align) ((DWORD_PTR)(p) & ~((DWORD_PTR)(align)-1))
28
29#define get_page_size() sysinfo_cache.dwPageSize
30#define get_allocation_unit() sysinfo_cache.dwAllocationGranularity
31#define get_processor_type() sysinfo_cache.dwProcessorType
32#define get_w32_major_version() w32_major_version
33#define get_w32_minor_version() w32_minor_version
34
35extern SYSTEM_INFO sysinfo_cache;
36extern OSVERSIONINFO osinfo_cache;
c7b36b95 37extern DWORD_PTR syspage_mask;
501199a3
DC
38
39extern int w32_major_version;
40extern int w32_minor_version;
41extern int w32_build_number;
42
43enum {
44 OS_9X = 1,
45 OS_NT
46};
47
48extern int os_subtype;
49
50/* Cache system info, e.g., the NT page size. */
51extern void cache_system_info (void);
52
53#endif /* W32COMMON_H */