Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
@@ -3,11 +3,11 @@
* Name: acmsvc.h - VC specific defines, etc.
*
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -42,10 +42,32 @@
*/
#ifndef __ACMSVC_H__
#define __ACMSVC_H__
+
+/*
+ * Map low I/O functions for MS. This allows us to disable MS language
+ * extensions for maximum portability.
+ */
+#define open _open
+#define read _read
+#define write _write
+#define close _close
+#define stat _stat
+#define fstat _fstat
+#define mkdir _mkdir
+#define strlwr _strlwr
+#define O_RDONLY _O_RDONLY
+#define O_BINARY _O_BINARY
+#define O_CREAT _O_CREAT
+#define O_WRONLY _O_WRONLY
+#define O_TRUNC _O_TRUNC
+#define S_IREAD _S_IREAD
+#define S_IWRITE _S_IWRITE
+#define S_IFDIR _S_IFDIR
+
/* Eliminate warnings for "old" (non-secure) versions of clib functions */
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
@@ -122,6 +144,24 @@
#if _MSC_VER > 1200 /* Versions above VC++ 6 */
#pragma warning( disable : 4295 ) /* needed for acpredef.h array */
#endif
+
+/* Debug support. Must be last in this file, do not move. */
+
+#ifdef _DEBUG
+#include <crtdbg.h>
+
+/*
+ * Debugging memory corruption issues with windows:
+ * Add #include <crtdbg.h> to accommon.h if necessary.
+ * Add _ASSERTE(_CrtCheckMemory()); where needed to test memory integrity.
+ * This can quickly localize the memory corruption.
+ */
+#define ACPI_DEBUG_INITIALIZE() \
+ _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | \
+ _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_CRT_DF | \
+ _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
+#endif
+
#endif /* __ACMSVC_H__ */