Skip to content

Replace -DLINUX/-DLINUX_ with __linux__ #1296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Tools/MediaDriverTools/GenDmyHex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ cmake_minimum_required (VERSION 2.8)
project(IntelGenDmyHexTool)
add_compile_options(-std=c++11)

add_definitions(-DLINUX_)

add_executable(GenDmyHex main.cpp)
2 changes: 0 additions & 2 deletions Tools/MediaDriverTools/GenKrnBin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ set(HEADERS_
linkfile.h
)

add_definitions(-DLINUX_)

add_executable(GenKrnBin ${SOURCE_} ${HEADERS_})
8 changes: 4 additions & 4 deletions Tools/MediaDriverTools/GenKrnBin/linkfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#include <stdlib.h>
#include "linkfile.h"

#ifdef LINUX_
#ifdef __linux__
#include <strings.h>
#include <cstring>
#endif

#ifdef LINUX_
#ifdef __linux__
#define StrCmp strcasecmp
#else
#define StrCmp stricmp
Expand Down Expand Up @@ -81,7 +81,7 @@ void CreateLinkFile(char *pDirectoryName, list <string> &kernels)
string name_hex;

// Create full LinkFile binary name
#ifdef LINUX_
#ifdef __linux__
sprintf(LinkFileTxt, "%s/%s", pDirectoryName, "LinkFile.txt");
#else
sprintf(LinkFileTxt, "%s\\%s", pDirectoryName, "LinkFile.txt");
Expand All @@ -90,7 +90,7 @@ void CreateLinkFile(char *pDirectoryName, list <string> &kernels)
if (hText == NULL) goto done;

// Create full LinkFile binary name - remove pre-existing file
#ifdef LINUX_
#ifdef __linux__
sprintf(LinkFileBin, "%s/%s", pDirectoryName, "LinkFile.krn");
#else
sprintf(LinkFileBin, "%s\\%s", pDirectoryName, "LinkFile.krn");
Expand Down
16 changes: 8 additions & 8 deletions Tools/MediaDriverTools/GenKrnBin/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <algorithm>
#include "linkfile.h"

#ifdef LINUX_
#ifdef __linux__
#include <dirent.h>
#include <sys/stat.h>
#include <strings.h>
Expand Down Expand Up @@ -80,7 +80,7 @@ static const char *COPYRIGHT =
#define KERNEL_ID_ENTRY(index) " _" "T(\"%03d\"),\\\n", \
index

#ifdef LINUX_
#ifdef __linux__
#define StrCmp strncasecmp
#else
#define StrCmp strnicmp
Expand All @@ -106,7 +106,7 @@ unsigned int *g_pOffsetTable;
unsigned int g_dwOffsetTableSize;
unsigned int g_dwCurrentKernel;

#ifdef LINUX_
#ifdef __linux__
char strupr(char *str)
{
char *ptr = str;
Expand Down Expand Up @@ -155,7 +155,7 @@ int main(int argc, char *argv[])
++idx;
}

#ifdef LINUX_
#ifdef __linux__
sprintf(KERNEL_COMPONENT_DIR,"%s", argv[1]);
strncpy(KERNEL_HEADER_PREFIX, argv[2], sizeof(KERNEL_HEADER_PREFIX));
strncpy(KERNEL_HEADER_GEN, argv[3], sizeof(KERNEL_HEADER_GEN));
Expand Down Expand Up @@ -189,7 +189,7 @@ int main(int argc, char *argv[])
/////////////////////////////////////////////////


#ifdef LINUX_
#ifdef __linux__
sprintf(SearchString, "%s", KERNEL_COMPONENT_DIR);

struct dirent* ent = NULL;
Expand Down Expand Up @@ -319,7 +319,7 @@ int main(int argc, char *argv[])
fwrite( g_pOffsetTable, 1, g_dwOffsetTableSize, (FILE *)g_hKernelBinary);

// create link information for the current family folder
#ifdef LINUX_
#ifdef __linux__
sprintf(KernelNameFull, "%s", KERNEL_COMPONENT_DIR);
#else
sprintf(KernelNameFull, "%s", KERNEL_COMPONENT_DIR);
Expand All @@ -332,7 +332,7 @@ int main(int argc, char *argv[])
{
// check if this kernel exists for this platform
// cFileName contains file name
#ifdef LINUX_
#ifdef __linux__
sprintf(KernelNameFull, "%s/%s", KERNEL_COMPONENT_DIR, iterator->c_str());
#else
sprintf(KernelNameFull, "%s\\%s", KERNEL_COMPONENT_DIR, iterator->c_str());
Expand All @@ -347,7 +347,7 @@ int main(int argc, char *argv[])

fclose(g_hKernelBinary);

#ifdef LINUX_
#ifdef __linux__
sprintf(KernelNameFull, "%s", KERNEL_COMPONENT_DIR);
#else
sprintf(KernelNameFull, "%s", KERNEL_COMPONENT_DIR);
Expand Down
2 changes: 0 additions & 2 deletions Tools/MediaDriverTools/KernelBinToSource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ cmake_minimum_required (VERSION 2.8)
project(IntelKernelBinToSourceTool)
add_compile_options(-std=c++11)

add_definitions(-DLINUX_)

add_executable(KernelBinToSource KernelBinToSource.cpp)
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static const char *PARAM_V = "-v";
static const char *PARAM_INDEX = "-index";
static const char *PARAM_TOTAL = "-t";

#ifdef LINUX_
#ifdef __linux__
static const char *FILE_SEP = "/";
#else
static const char *FILE_SEP = "\\";
Expand Down Expand Up @@ -111,7 +111,7 @@ std::string appendPath(
//-----------------------------------------------------------------------------
std::string getFileName(const std::string &sFilePath)
{
#ifdef LINUX_
#ifdef __linux__
std::string::size_type uiLoc = sFilePath.rfind("/");
#else
std::string::size_type uiLoc = sFilePath.rfind("\\");
Expand Down
2 changes: 0 additions & 2 deletions Tools/MediaDriverTools/KrnToHex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ cmake_minimum_required (VERSION 2.8)
project(KrnToHexTool)
add_compile_options(-std=c++11)

add_definitions(-DLINUX_)

add_executable(KrnToHex KrnToHex.cpp)
2 changes: 0 additions & 2 deletions Tools/MediaDriverTools/KrnToHex_IGA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@ set(SOURCE_
KrnToHex_IGA.cpp
)

add_definitions(-DLINUX_)

add_executable(KrnToHex_IGA ${SOURCE_})
2 changes: 1 addition & 1 deletion Tools/MediaDriverTools/KrnToHex_IGA/KrnToHex_IGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define MAX_FILE_PATH 4096
#define MAX_FILE_NAME 260

#ifdef LINUX_
#ifdef __linux__
#define StrCmp strcasecmp
#else
#define StrCmp stricmp
Expand Down
2 changes: 1 addition & 1 deletion media_driver/agnostic/common/cm/cm_hal_dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "renderhal_platform_interface.h"

#if (MDF_COMMAND_BUFFER_DUMP || MDF_CURBE_DATA_DUMP || MDF_SURFACE_STATE_DUMP)
#if defined(ANDROID) || defined(LINUX)
#if defined(ANDROID) || defined(__linux__)
#define PlatformSNPrintf snprintf
#define PLATFORM_DIR_SEPERATOR "/"
#else
Expand Down
2 changes: 1 addition & 1 deletion media_driver/agnostic/common/cm/cm_media_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ MOS_STATUS CmMediaState::Submit()
return MOS_STATUS_SUCCESS;
}

#if defined(ANDROID) || defined(LINUX)
#if defined(ANDROID) || defined(__linux__)
#define PLATFORM_DIR_SEPERATOR "/"
#else
#define PLATFORM_DIR_SEPERATOR "\\"
Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/cm/cm_mem_sse2_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "cm_mem.h"
#include "cm_mem_sse2_impl.h"

#if defined(__SSE2__) || !(defined(LINUX) || defined(ANDROID))
#if defined(__SSE2__) || !(defined(__linux__) || defined(ANDROID))

#include <mmintrin.h>

Expand Down Expand Up @@ -311,4 +311,4 @@ void CmFastMemCopyWC_SSE2( void* dst, const void* src, const size_t bytes )
}
}

#endif // __SSE2__ || !(LINUX || ANDROID)
#endif // __SSE2__ || !(__linux__ || ANDROID)
2 changes: 1 addition & 1 deletion media_driver/agnostic/common/cm/cm_ssh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ MOS_STATUS CmSSH::PrepareResourcesForCp()

using namespace std;

#if defined(ANDROID) || defined(LINUX)
#if defined(ANDROID) || defined(__linux__)
#define PLATFORM_DIR_SEPERATOR "/"
#else
#define PLATFORM_DIR_SEPERATOR "\\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ MOS_STATUS CodechalEncodeCscDs::RawSurfaceMediaCopy(MOS_FORMAT srcFormat)
auto cscSurface = m_encoder->m_trackedBuf->GetCscSurface(CODEC_CURR_TRACKED_BUFFER);

// Copy through VEBOX from Linear/TileY to TileY
#ifdef LINUX
#ifdef __linux__
CODECHAL_ENCODE_CHK_STATUS_RETURN(m_pMosMediaCopy->MediaCopy(
&m_rawSurfaceToEnc->OsResource,
&cscSurface->OsResource,
Expand All @@ -1894,7 +1894,7 @@ MOS_STATUS CodechalEncodeCscDs::RawSurfaceMediaCopy(MOS_FORMAT srcFormat)
&cscSurface->OsResource,
false,
MCPY_METHOD_BALANCE));
#endif // LINUX
#endif // __linux__

CODECHAL_ENCODE_CHK_STATUS_RETURN(SetSurfacesToEncPak());

Expand Down
4 changes: 2 additions & 2 deletions media_driver/agnostic/common/vp/hal/vphal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ MOS_STATUS VphalState::GetStatusReport(
continue;
}

#if (LINUX || ANDROID)
#if (__linux__ || ANDROID)
dwGpuTag = pOsContext->GetGPUTag(m_osInterface, pStatusEntry->GpuContextOrdinal);
#else
dwGpuTag = m_osInterface->pfnGetGpuStatusSyncTag(m_osInterface, pStatusEntry->GpuContextOrdinal);
Expand All @@ -818,7 +818,7 @@ MOS_STATUS VphalState::GetStatusReport(
}
else
{ // here we have the first not ready entry.
#if (LINUX || ANDROID)
#if (__linux__ || ANDROID)
uiNewHead = (uiIndex + 1) & (VPHAL_STATUS_TABLE_MAX_SIZE - 1);
#else
uiNewHead = uiIndex;
Expand Down
6 changes: 3 additions & 3 deletions media_driver/agnostic/common/vp/hal/vphal_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ void VphalSurfaceDumper::GetSurfaceDumpSpec()
UserFeatureData.StringData.pStringData,
UserFeatureData.StringData.uSize);
}
#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
else
{
std::string vphalDumpFilePath;
Expand Down Expand Up @@ -2519,7 +2519,7 @@ void VphalHwStateDumper::GetStateDumpSpec()
pUserFeatureData->StringData.pStringData,
pUserFeatureData->StringData.uSize);
}
#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
else
{
std::string vphalDumpFilePath;
Expand Down Expand Up @@ -3161,7 +3161,7 @@ void VphalParameterDumper::GetParametersDumpSpec()
UserFeatureData.StringData.uSize);
bDumpEnabled = true;
}
#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
else
{
std::string vphalDumpFilePath;
Expand Down
2 changes: 1 addition & 1 deletion media_driver/agnostic/common/vp/hal/vphal_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "renderhal.h"
#include "mhw_vebox.h"

#if !defined(LINUX) && !defined(ANDROID)
#if !defined(__linux__) && !defined(ANDROID)
#include "UmdStateSeparation.h"
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ MOS_STATUS VpHal_16AlignLoadStaticData(
eStatus = MOS_STATUS_INVALID_PARAMETER;
break;
}
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW10.Output_Pitch = p16AlignState->pTarget->OsResource.iPitch;
WalkerStatic.DW10.Output_Height = p16AlignState->pTarget->OsResource.iHeight;
#endif
Expand Down Expand Up @@ -1049,7 +1049,7 @@ MOS_STATUS VpHal_16AlignSetupSurfaceStatesInt(
PRENDERHAL_SURFACE_STATE_ENTRY pSurfaceEntry;
MOS_FORMAT format = pSurface->Format;
uint32_t width = pSurface->dwWidth;
#if defined(LINUX)
#if defined(__linux__)
uint32_t dwSize = pSurface->dwHeight * pSurface->OsResource.iPitch;
#else
uint32_t dwSize = pSurface->dwHeight * pSurface->dwPitch;
Expand Down
8 changes: 4 additions & 4 deletions media_driver/agnostic/common/vp/hal/vphal_render_fast1ton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ MOS_STATUS VpHal_Fast1toNLoadStaticData(
{
WalkerStatic.DW4.Dst_Index0 = FAST1TON_DST_INDEX0;
WalkerStatic.DW10.Dst_16Aligned |= ALIGN16_DST0;
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW10.Dst_pitch0 = pFast1toNState->pTarget[0]->OsResource.iPitch;
WalkerStatic.DW12.Dst_UVOffset0 = pFast1toNState->pTarget[0]->OsResource.iHeight;
#endif
Expand All @@ -131,7 +131,7 @@ MOS_STATUS VpHal_Fast1toNLoadStaticData(
{
WalkerStatic.DW6.Dst_Index1 = FAST1TON_DST_INDEX1;
WalkerStatic.DW10.Dst_16Aligned |= ALIGN16_DST1;
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW11.Dst_pitch1 = pFast1toNState->pTarget[1]->OsResource.iPitch;
WalkerStatic.DW12.Dst_UVOffset1 = pFast1toNState->pTarget[1]->OsResource.iHeight;
#endif
Expand All @@ -154,7 +154,7 @@ MOS_STATUS VpHal_Fast1toNLoadStaticData(
{
WalkerStatic.DW8.Dst_Index2 = FAST1TON_DST_INDEX2;
WalkerStatic.DW10.Dst_16Aligned |= ALIGN16_DST2;
#if defined(LINUX)
#if defined(__linux__)
WalkerStatic.DW11.Dst_pitch2 = pFast1toNState->pTarget[2]->OsResource.iPitch;
WalkerStatic.DW13.Dst_UVOffset2 = pFast1toNState->pTarget[2]->OsResource.iHeight;
#endif
Expand Down Expand Up @@ -1047,7 +1047,7 @@ MOS_STATUS VpHal_Fast1toNSetupSurfaceStates(
format = pFast1toNState->pTarget[index]->Format;
width = pFast1toNState->pTarget[index]->dwWidth;
pFast1toNState->pTarget[index]->Format = Format_RAW;
#if defined(LINUX)
#if defined(__linux__)
pFast1toNState->pTarget[index]->dwWidth = (pFast1toNState->pTarget[index]->dwHeight * pFast1toNState->pTarget[index]->OsResource.iPitch) * 3/2;
#endif
pFast1toNState->pTarget[index]->dwWidth = MOS_ALIGN_CEIL(pFast1toNState->pTarget[index]->dwWidth, 128);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ MOS_STATUS MediaVeboxDecompState::MediaMemoryCopy(
targetSurface.Format = Format_Invalid;
targetSurface.OsResource = *outputResource;

#if !defined(LINUX) && !defined(ANDROID) && !EMUL
#if !defined(__linux__) && !defined(ANDROID) && !EMUL
// for Double Buffer copy, clear the allocationInfo temply
MOS_ZeroMemory(&targetSurface.OsResource.AllocationInfo, sizeof(SResidencyInfo));
#endif
Expand Down Expand Up @@ -355,7 +355,7 @@ MOS_STATUS MediaVeboxDecompState::MediaMemoryCopy2D(
targetSurface.Format = Format_Invalid;
targetSurface.OsResource = *outputResource;

#if !defined(LINUX) && !defined(ANDROID) && !EMUL
#if !defined(__linux__) && !defined(ANDROID) && !EMUL
// for Double Buffer copy, clear the allocationInfo temply
MOS_ZeroMemory(&targetSurface.OsResource.AllocationInfo, sizeof(SResidencyInfo));
#endif
Expand Down Expand Up @@ -470,7 +470,7 @@ MOS_STATUS MediaVeboxDecompState::MediaMemoryTileConvert(
targetSurface.Format = Format_Invalid;
targetSurface.OsResource = *outputResource;

#if !defined(LINUX) && !defined(ANDROID) && !EMUL
#if !defined(__linux__) && !defined(ANDROID) && !EMUL
// for Double Buffer copy, clear the allocationInfo temply
MOS_ZeroMemory(&targetSurface.OsResource.AllocationInfo, sizeof(SResidencyInfo));
#endif
Expand Down
6 changes: 3 additions & 3 deletions media_driver/agnostic/common/vp/kdll/hal_kerneldll.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#if EMUL || VPHAL_LIB
#include <math.h>
#include "support.h"
#elif LINUX
#else // !(EMUL | VPHAL_LIB) && !LINUX
#elif __linux__
#else // !(EMUL | VPHAL_LIB) && !__linux__

#endif // EMUL | VPHAL_LIB

Expand Down Expand Up @@ -4943,7 +4943,7 @@ bool KernelDll_BuildKernel_CmFc(Kdll_State *pState, Kdll_SearchState *pSearchSta
VPHAL_RENDER_FUNCTION_ENTER;

// Disable pop-up box window for STL assertion to avoid VM hang in auto test.
#if (!LINUX)
#if (!__linux__)
::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#if defined(_MSC_VER)
::_set_error_mode(_OUT_TO_STDERR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ MOS_STATUS CodechalDecodeVp9G12 :: DecodePrimitiveLevel()
m_osInterface,
&syncParams));

#ifdef LINUX
#ifdef __linux__
#ifdef _DECODE_PROCESSING_SUPPORTED
CODECHAL_DEBUG_TOOL(
if (m_sfcState->m_sfcOutputSurface)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3324,7 +3324,7 @@ MOS_STATUS CodechalVdencVp9StateG12::SetSequenceStructs()

CODECHAL_ENCODE_FUNCTION_ENTER;

#ifdef LINUX
#ifdef __linux__
MOS_SURFACE rawSurface;
PCODEC_VP9_ENCODE_SEQUENCE_PARAMS seqParams = (PCODEC_VP9_ENCODE_SEQUENCE_PARAMS)m_encodeParams.pSeqParams;
rawSurface = *(m_encodeParams.psRawSurface);
Expand Down
Loading