1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Remove windows ifdefs

This commit is contained in:
Leonid Fedorov
2023-03-02 15:59:42 +00:00
parent 123c345b40
commit 56f2346083
328 changed files with 9 additions and 19602 deletions

View File

@ -25,11 +25,7 @@
#include <we_obj.h>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -60,9 +60,6 @@ BRMWrapper* volatile BRMWrapper::m_instance = NULL;
boost::thread_specific_ptr<int> BRMWrapper::m_ThreadDataPtr;
boost::mutex BRMWrapper::m_instanceCreateMutex;
#ifdef _MSC_VER
__declspec(dllexport)
#endif
bool BRMWrapper::m_useVb = true;
OID BRMWrapper::m_curVBOid = INVALID_NUM;

View File

@ -38,11 +38,7 @@
#include "IDBDataFile.h"
#include "IDBPolicy.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine
@ -470,9 +466,6 @@ class BRMWrapper : public WEObj
static boost::thread_specific_ptr<int> m_ThreadDataPtr;
static boost::mutex m_instanceCreateMutex;
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT static bool m_useVb;
static OID m_curVBOid;

View File

@ -26,12 +26,6 @@
#pragma once
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#include <boost/thread/mutex.hpp>
#endif
#include <set>
#include <string>
#include <sstream>
@ -41,11 +35,7 @@
#include "messagelog.h"
#include "messageobj.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -31,9 +31,6 @@ CacheControl* Cache::m_cacheParam = NULL;
FreeBufList* Cache::m_freeList = NULL;
CacheMap* Cache::m_lruList = NULL;
CacheMap* Cache::m_writeList = NULL;
#ifdef _MSC_VER
__declspec(dllexport)
#endif
bool Cache::m_useCache = false;
/***********************************************************
* DESCRIPTION:

View File

@ -23,25 +23,17 @@
#pragma once
#include <iostream>
#ifdef _MSC_VER
#include <unordered_map>
#else
#if __GNUC__ == 4 && __GNUC_MINOR__ < 2
#include <ext/hash_map>
#else
#include <tr1/unordered_map>
#endif
#endif
#include <map>
#include <we_obj.h>
#include <we_convertor.h>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine
{
@ -223,9 +215,6 @@ class Cache
static CacheMap* m_lruList; // LRU buffer list
static CacheMap* m_writeList; // Write buffer list
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT static bool m_useCache; // Use cache flag
private:
};

View File

@ -2018,14 +2018,6 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
if (rc == NO_ERROR)
{
#ifdef _MSC_VER
// We need to do this early on so the ::rename() call below will work on Windows
// we'll do it again later on, but that's life...
// FIXME: there's a race here that a query will re-open the files before we can jigger
// them around. We need to make sure PP is opening these files with the right perms
// to allow another process to delete them.
cacheutils::dropPrimProcFdCache();
#endif
// @bug3913, keep the original file until the new file is properly renamed.
// 1. check the new file size is NOT 0, matching ptr[k].

View File

@ -33,17 +33,8 @@
#include "idbcompress.h"
#include "IDBFileSystem.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#ifdef _MSC_VER
#define WE_COMP_DBG(x) \
{ \
}
#else
//#define IDB_COMP_DEBUG
#ifdef IDB_COMP_DEBUG
#define WE_COMP_DBG(x) \
@ -55,7 +46,6 @@
{ \
}
#endif
#endif
namespace logging
{

View File

@ -119,9 +119,7 @@ void Config::checkReload()
if (m_bulkRoot.length() == 0)
{
m_bulkRoot = "/var/log/mariadb/columnstore";
#ifndef _MSC_VER
m_bulkRoot += "/data";
#endif
m_bulkRoot += "/bulk";
}

View File

@ -32,11 +32,7 @@
//#define SHARED_NOTHING_DEMO_2
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -24,11 +24,7 @@
#include "IDBFileSystem.h"
#include "we_type.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -26,9 +26,6 @@
#include <limits>
#include <cstring>
#include <vector>
#ifdef _MSC_VER
#include <cstdio>
#endif
#include "mcsconfig.h"
#include "we_convertor.h"

View File

@ -35,11 +35,7 @@
#include "we_obj.h"
#include "we_config.h"
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -26,11 +26,7 @@
#include "we_blockop.h"
#include "we_cache.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -40,11 +40,7 @@
#include "we_type.h"
#include "brmtypes.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -26,11 +26,7 @@
#include <map>
#include <stdint.h>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -30,7 +30,7 @@
#if defined(__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#elif !defined(_MSC_VER)
#else
#include <sys/vfs.h>
#endif
#include <boost/filesystem/operations.hpp>
@ -737,13 +737,7 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width,
}
}
#ifdef _MSC_VER
// Need to call the win version with a dir, not a file
if (!isDiskSpaceAvail(Config::getDBRootByNum(dbRoot), allocSize))
#else
if (!isDiskSpaceAvail(segFile, allocSize))
#endif
{
return ERR_FILE_DISK_SPACE;
}
@ -868,13 +862,7 @@ int FileOp::addExtentExactFile(OID oid, const uint8_t* emptyVal, int width, int&
}
}
#ifdef _MSC_VER
// Need to call the win version with a dir, not a file
if (!isDiskSpaceAvail(Config::getDBRootByNum(dbRoot), allocSize))
#else
if (!isDiskSpaceAvail(segFile, allocSize))
#endif
{
return ERR_FILE_DISK_SPACE;
}
@ -2556,25 +2544,6 @@ bool FileOp::isDiskSpaceAvail(const std::string& fileName, int nBlocks) const
if (maxDiskUsage < 100) // 100% means to disable the check
{
#ifdef _MSC_VER
ULARGE_INTEGER freeBytesAvail;
ULARGE_INTEGER totalBytesAvail;
if (GetDiskFreeSpaceEx(fileName.c_str(), &freeBytesAvail, &totalBytesAvail, 0) != 0)
{
double avail = (double)freeBytesAvail.QuadPart;
double total = (double)totalBytesAvail.QuadPart;
double wanted = (double)nBlocks * (double)BYTE_PER_BLOCK;
// If we want more than there is, return an error
if (wanted > avail)
bSpaceAvail = false;
// If the remaining bytes would be too few, return an error
else if ((total - (avail - wanted)) / total * 100.0 > maxDiskUsage)
bSpaceAvail = false;
}
#else
struct statfs fStats;
int rc = statfs(fileName.c_str(), &fStats);
@ -2596,7 +2565,6 @@ bool FileOp::isDiskSpaceAvail(const std::string& fileName, int nBlocks) const
//"; bAvail: " << bSpaceAvail << std::endl;
}
#endif
}
return bSpaceAvail;

View File

@ -27,15 +27,6 @@
#include <map>
#include <boost/thread.hpp>
#ifdef _MSC_VER
#include <direct.h>
#define S_IRWXU 0
#define S_IRWXG 0
#ifndef S_IROTH
#define S_IROTH 0
#endif
#define S_IXOTH 0
#endif
#include "we_blockop.h"
#include "we_brm.h"
@ -44,11 +35,7 @@
#include "idbcompress.h"
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#define MAX_NBLOCKS 8192

View File

@ -70,11 +70,7 @@ void Log::formatMsg(const std::string& msg, MsgLevel level, std::ostringstream&
if (isDebug(DEBUG_2))
{
oss << " (" << m_pid << ":" <<
#ifdef _MSC_VER
GetCurrentThreadId()
#else
pthread_self()
#endif
<< ") " << MSG_LEVEL_STR[level] << " : " << msg;
}
else
@ -155,19 +151,6 @@ void Log::setLogFileName(const char* logfile, const char* errlogfile, bool conso
m_logFileName = logfile;
m_errlogFileName = errlogfile;
m_bConsoleOutput = consoleFlag;
#ifdef _MSC_VER
// cpimport.bin calls BulkLoad::loadJobInfo() before calling
// BulkLoad::processJob(). loadJobInfo() attempts to write to this log
// before it's opened (by processJob()). This doesn't seem to bother Linux
// but puts Windows in a bad state. Once this logic is fixed, this hack can
// go away.
// This code probably wouldn't hurt if run on Linux, but I'll leave this
// here as a reminder to fix the logic for all platforms.
m_logFile.close();
m_logFile.clear();
m_errLogFile.close();
m_errLogFile.clear();
#endif
m_logFile.open(m_logFileName.c_str(), std::ofstream::out | std::ofstream::app);
m_errLogFile.open(m_errlogFileName.c_str(), std::ofstream::out | std::ofstream::app);
}

View File

@ -35,11 +35,7 @@
#include <boost/thread.hpp>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -1147,13 +1147,6 @@ int RBMetaWriter::writeHWMChunk(bool bColumnFile, // is this a column (vs dic
// IDBDataFile flush() does a sync where appropriate
delete backupFile;
#ifdef _MSC_VER
// Windows rename() behaves differently from Linux: it will return an error
// if the target exists
// FIXME: The Linux version seems a bit safer, perhaps implement a better
// Windows port?
unlink(fileName.c_str());
#endif
// Rename HWM backup file to final name.
if (fs.rename(fileNameTmp.c_str(), fileName.c_str()))

View File

@ -40,11 +40,7 @@
#include "brmtypes.h"
#include "we_fileop.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#define DBROOT_BULK_ROLLBACK_SUBDIR "bulkRollback"

View File

@ -28,11 +28,7 @@
#include "messagelog.h"
#include "messageobj.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine