Skip to content

Commit

Permalink
ACPICA: MSVC9: Fix <sys/stat.h> inclusion order issue
Browse files Browse the repository at this point in the history
ACPICA commit 9bb265c2afb9910e46f820d6759648580edabd09

When /Za is specified, headers of some Windows SDKs contain bugs breaking
VC builds, and MSVC9's default SDK is one of such header-buggy library.

In order to solve this issue, many VC developers stop using /Za. However
we've been asked to have this fixed without removing /Za.

In MSVC9 default SDK, this issue can be fixed by restricting <sys/stat.h>
to be the last standard file included by every source file in the projects.
This patch thus moves <sys/stat.h> inclusion to "acapps.h", so that this
issue can be fixed by ensuring that "acapps.h" is always the last standard
file included by all of the ACPICA source files. This is in fact also a
useful cleanup because applications can only include one header (e.x.,
acpidump.h) instead of including acapps.h separately. Lv Zheng.

Except some harmless header inclusion re-ordering, Linux kernel is not
affected by this change.

Link: https://github.com/acpica/acpica/commit/9bb265c2
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Aug 13, 2016
1 parent 4e2fc6a commit e323c02
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/acpica/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#ifndef _ACAPPS
#define _ACAPPS

#ifdef ACPI_USE_STANDARD_HEADERS
#include <sys/stat.h>
#endif /* ACPI_USE_STANDARD_HEADERS */

/* Common info for tool signons */

#define ACPICA_NAME "Intel ACPI Component Architecture"
Expand Down
3 changes: 2 additions & 1 deletion include/acpi/platform/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <time.h>
#include <signal.h>
#endif

#endif /* ACPI_USE_STANDARD_HEADERS */
Expand Down
1 change: 1 addition & 0 deletions tools/power/acpi/tools/acpidump/acpidump.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <acpi/acpi.h>
#include "accommon.h"
#include "actables.h"
#include "acapps.h"

/* Globals */

Expand Down
1 change: 0 additions & 1 deletion tools/power/acpi/tools/acpidump/apfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
*/

#include "acpidump.h"
#include "acapps.h"

/* Local prototypes */

Expand Down
1 change: 0 additions & 1 deletion tools/power/acpi/tools/acpidump/apmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

#define _DECLARE_GLOBALS
#include "acpidump.h"
#include "acapps.h"

/*
* acpidump - A portable utility for obtaining system ACPI tables and dumping
Expand Down

0 comments on commit e323c02

Please sign in to comment.