Skip to content

Commit

Permalink
Merge pull request eclipse-omr#6047 from jamesgua/CallStackHeader
Browse files Browse the repository at this point in the history
Add guarding macro when including OS specific header
  • Loading branch information
0xdaryl authored Jun 17, 2021
2 parents 92b5140 + b12110c commit b7eb963
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/ras/CallStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ bool TR_MvsCallStackIterator::getNext ()

#elif defined(OMR_OS_WINDOWS) && defined(TR_HOST_X86) && defined(TR_HOST_32BIT)

#include "ras/CallStack.hpp"
#include <windows.h>
#include <Winbase.h>
#include "ras/CallStack.hpp"

uintptr_t TR_WinCallStackIterator::getOffsetInProcedure()
{
Expand Down
11 changes: 9 additions & 2 deletions compiler/ras/CallStack.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2016 IBM Corp. and others
* Copyright (c) 2000, 2021 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand All @@ -19,7 +19,10 @@
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/

#include <windows.h>
#ifndef CALLSTACK_INCL
#define CALLSTACK_INCL

#if defined(OMR_OS_WINDOWS) && defined(TR_HOST_X86) && defined(TR_HOST_32BIT)
//
// StackWalking API
//
Expand Down Expand Up @@ -154,3 +157,7 @@ typedef BOOL (__stdcall * StackWalk64Type)(
StackWalk64Type StackWalk64;
typedef BOOL (__stdcall * SymFromAddrType)( HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO);
typedef BOOL (__stdcall * SymCleanupType) ( HANDLE);

#endif /* defined(OMR_OS_WINDOWS) && defined(TR_HOST_X86) && defined(TR_HOST_32BIT)) */

#endif

0 comments on commit b7eb963

Please sign in to comment.