diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2009-02-13 17:29:02 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2009-02-13 17:29:02 +0200 |
commit | 96c46df7deb231ea68a03d8d1da9de4c774e36d8 (patch) | |
tree | 6788af6a63bd9bdc77f318b7581b43e859e1a44c /src/common | |
parent | Remove dead directories from .gitignore. (diff) | |
download | xz-96c46df7deb231ea68a03d8d1da9de4c774e36d8.tar.xz |
Improve support for DOS-like systems.
Here DOS-like means DOS, Windows, and OS/2.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/physmem.h | 12 | ||||
-rw-r--r-- | src/common/sysdefs.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/common/physmem.h b/src/common/physmem.h index c9d50394..fb17eac5 100644 --- a/src/common/physmem.h +++ b/src/common/physmem.h @@ -34,6 +34,10 @@ # include <windows.h> #endif +#ifdef __DJGPP__ +# include <dpmi.h> +#endif + /// \brief Get the amount of physical memory in bytes /// @@ -76,6 +80,14 @@ physmem(void) meminfo.dwLength = sizeof(meminfo); if (GlobalMemoryStatusEx(&meminfo)) ret = meminfo.ullTotalPhys; + +#elif defined(__DJGPP__) + __dpmi_free_mem_info meminfo; + if (__dpmi_get_free_memory_information(&meminfo) == 0 + && meminfo.total_number_of_physical_pages + != (unsigned long)(-1)) + ret = (uint64_t)(meminfo.total_number_of_physical_pages) + * 4096; #endif return ret; diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h index f55c2360..5b8b9cec 100644 --- a/src/common/sysdefs.h +++ b/src/common/sysdefs.h @@ -154,6 +154,10 @@ typedef unsigned char _Bool; // Macros // //////////// +#if defined(_WIN32) || defined(__MSDOS__) || defined(__OS2__) +# define DOSLIKE 1 +#endif + #undef memzero #define memzero(s, n) memset(s, 0, n) |