Skip to content
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

Resolve build errors for CIDKernel, CIDLib, and tests on Linux + GCC 10 #1

Open
wants to merge 48 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9382a33
Support TFindInfo::m_bIsDir on Linux
DeclanHoare Sep 16, 2020
068d2d2
Change SystemInfo sigs on Linux to match headers
DeclanHoare Sep 16, 2020
c643cfd
Define CIDLib_Suppress on Linux
DeclanHoare Sep 16, 2020
b257298
Do not use token pasting to combine symbol and ::
DeclanHoare Sep 24, 2020
65551e5
Rename many shadowing template parameters
DeclanHoare Sep 24, 2020
2166802
Use TElem for comparator in bSearch
DeclanHoare Sep 24, 2020
16e4ce0
Remove 'static' from friend declarations
DeclanHoare Sep 24, 2020
8ff03e3
Split FundStack operators to separate header
DeclanHoare Sep 24, 2020
195f90f
Define m_pfcolStack
DeclanHoare Sep 25, 2020
361fe9b
Add facCIDLibEarly() and use it in some types
DeclanHoare Sep 25, 2020
1dfdafd
Split FundVector destructor to separate header
DeclanHoare Sep 25, 2020
008263a
Add and remove 'typename'/'class' for GCC pedantry
DeclanHoare Sep 25, 2020
a14b6d6
Move TStreamJanitor def. above TTextOutStream
DeclanHoare Sep 25, 2020
19c3a51
Remove variable names from function pointer types
DeclanHoare Sep 25, 2020
32a0c71
Move KeyedHashSet up so PolyStreamer can use it
DeclanHoare Sep 25, 2020
f7c5d93
Return a boolean from bCompKeys
DeclanHoare Sep 25, 2020
6fcaf5a
Replace non-existent symbols in HashMap
DeclanHoare Sep 25, 2020
7d2de4b
Remove more 'typename's
DeclanHoare Sep 25, 2020
e3791ac
Move operator guts to methods
DeclanHoare Sep 25, 2020
c1b749e
Move alignas to apply to variable
DeclanHoare Sep 25, 2020
7528bff
Add missing 'return'
DeclanHoare Sep 25, 2020
4918a8f
Remove duplicate explicit instantiations
DeclanHoare Sep 25, 2020
ee29f04
Use correct replacement for TParent
DeclanHoare Sep 25, 2020
4969642
Switch from __pragma to _Pragma
DeclanHoare Sep 25, 2020
bdb83b5
Rename c1Dummy to c1Alpha on Linux
DeclanHoare Sep 25, 2020
a32178a
Use reinterpret_cast in c4GenInitSerialNum()
DeclanHoare Sep 25, 2020
31ece29
Define eWCCharFmt on Linux
DeclanHoare Sep 25, 2020
7c58a3d
Remove 'static' from SendMsg
DeclanHoare Sep 25, 2020
40bd832
Move TStreamJanitor implementation out of header
DeclanHoare Sep 25, 2020
a7449c7
Add 'typename' needed in TestCIDLib_CommonCollect
DeclanHoare Sep 25, 2020
7026de9
Move operator guts into methods more
DeclanHoare Sep 25, 2020
237ec25
Add 'typename' in HashMap
DeclanHoare Sep 25, 2020
e77c6ed
Namespace the argc and argv externs
DeclanHoare Sep 25, 2020
1aa156c
Un-inline two string methods used outside the file
DeclanHoare Sep 25, 2020
e13179f
Implement SafeRefAcquire & Release on Linux
DeclanHoare Sep 25, 2020
d384efc
Use c8MaxCard as max seek position on Linux
DeclanHoare Sep 25, 2020
ca3015a
Implement bFlush on Linux
DeclanHoare Sep 25, 2020
79ba256
Implement GUIThread on Linux
DeclanHoare Sep 25, 2020
ba6b1b4
Implement bQuerySysErrMsg on Linux
DeclanHoare Sep 25, 2020
0926d03
Implement missing console methods on Linux
DeclanHoare Sep 25, 2020
6a28cc1
Change szPathSep to pszPathSep
DeclanHoare Sep 25, 2020
688d920
Parse hexadecimal from proc maps device numbers
DeclanHoare Sep 25, 2020
2833617
Check if threads are valid before destroying
DeclanHoare Sep 25, 2020
478b138
Implement bState in bWaitForDeath on Linux
DeclanHoare Sep 25, 2020
403249a
Link all dependencies in GCCDriver
DeclanHoare Sep 25, 2020
5ca5868
Implement GenerateCtrlCSignal on Linux
DeclanHoare Sep 25, 2020
86ef46c
Stub missing functions needed to link TestCIDLib
DeclanHoare Sep 25, 2020
18941f6
Check for invalid TID in bIsRunning
DeclanHoare Sep 25, 2020
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: 1 addition & 1 deletion Source/AllProjects/CIDBuild/CIDBuild_GCCDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ tCIDLib::TVoid TGCCDriver::Link()
{
do
{
TBldStr* pstrNew = new TBldStr(L"-lCIDKernel");
TBldStr* pstrNew = new TBldStr(cursLibs.tCurElement().strFileName());
listParms.Add(pstrNew);
} while (cursLibs.bNext());
}
Expand Down
5 changes: 5 additions & 0 deletions Source/AllProjects/CIDBuild/Linux/CIDBuild_FindInfo_Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,9 @@ TFindInfo::SetFromHostInfo( const tCIDLib::TVoid* const pHostFindBuf
// any platform can represent its time easily in a common format.
//
m_tmLastWrite = double(pFileInfo->StatBuf.st_mtime);

if (S_ISDIR(pFileInfo->StatBuf.st_mode))
m_bIsDir = kCIDLib::True;
else
m_bIsDir = kCIDLib::False;
}
36 changes: 32 additions & 4 deletions Source/AllProjects/CIDKernel/Linux/CIDKernel_Console_Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,24 @@ TConsoleHandle::FormatToStr( tCIDLib::TCh* const pszToFill
// TKrnlConIn: Public, non-virtual methods
// ---------------------------------------------------------------------------

tCIDLib::TBoolean
TKrnlConIn::bReadCharMS( tCIDLib::EConKeys& eKeyType
, tCIDLib::TCh& chGotten
, const tCIDLib::TCard4 c4Wait
, TIdleCB pfnCallback
, TObject* const pobjCBData)
{
// Just call the end time based one with the calculated end time
return bReadChar
(
eKeyType
, chGotten
, TKrnlTimeStamp::enctNow() + (c4Wait * kCIDLib::enctOneMilliSec)
, pfnCallback
, pobjCBData
);
}

tCIDLib::TBoolean
TKrnlConIn::bReadChar( tCIDLib::EConKeys& keyType
, tCIDLib::TCh& chGotten
Expand Down Expand Up @@ -728,18 +746,28 @@ tCIDLib::TVoid TKrnlConIn::TermPlatform()
// ---------------------------------------------------------------------------
// TKrnlConOut: Public, non-virtual methods
// ---------------------------------------------------------------------------
tCIDLib::TBoolean TKrnlConOut::bClearScr()
static inline tCIDLib::TBoolean bWriteTermCap(const tCIDLib::TSCh* pszTermCapName)
{
tCIDLib::TSCh* pszClear = ::tigetstr("clear");
if (!pszClear)
tCIDLib::TSCh* pszTermCapVal = ::tigetstr(pszTermCapName);
if (!pszTermCapVal)
{
TKrnlError::SetLastKrnlError(kKrnlErrs::errcData_ZeroSizedBuffer);
return kCIDLib::False;
}
::tputs(pszClear, 1, putchar);
::tputs(pszTermCapVal, 1, putchar);
return kCIDLib::True;
}

tCIDLib::TBoolean TKrnlConOut::bBackspace()
{
return bWriteTermCap("cursor_left");
}

tCIDLib::TBoolean TKrnlConOut::bClearScr()
{
return bWriteTermCap("clear");
}

tCIDLib::TBoolean TKrnlConOut::bPutChar(const tCIDLib::TCh chToWrite)
{
tCIDLib::TSCh szMultiByte[MB_LEN_MAX];
Expand Down
13 changes: 13 additions & 0 deletions Source/AllProjects/CIDKernel/Linux/CIDKernel_Error_Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,19 @@ const TKrnlError& TKrnlError::kerrLast()
}


// Load the message text for the indicated OS error code
tCIDLib::TBoolean
TKrnlError::bQuerySysErrMsg(const tCIDLib::TOSErrCode errcGet
, tCIDLib::TCh* const pszToFill
, const tCIDLib::TCard4 c4MaxChars)
{
char schErrorNarrow[c4MaxChars] = {0};
::strerror_r(errcGet, schErrorNarrow, sizeof(schErrorNarrow));
::swprintf(pszToFill, c4MaxChars, L"%s", schErrorNarrow);
return kCIDLib::True;
}


tCIDLib::TVoid
TKrnlError::ThrowHostError(const tCIDLib::TOSErrCode errcHostId)
{
Expand Down
23 changes: 23 additions & 0 deletions Source/AllProjects/CIDKernel/Linux/CIDKernel_Event_Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ TEventHandle::FormatToStr( tCIDLib::TCh* const pszToFill
// PREFIX: kev
// ---------------------------------------------------------------------------

// ---------------------------------------------------------------------------
// TKrnlEvent: Public, static methods
// ---------------------------------------------------------------------------
tCIDLib::TBoolean
TKrnlEvent::bWaitMultiple( TKrnlEvent& kevOne
, TKrnlEvent& kevTwo
, tCIDLib::TCard4& c4Which
, const tCIDLib::TCard4 c4Wait)
{
// <TBD>
TKrnlError::SetLastKrnlError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


// ---------------------------------------------------------------------------
// TKrnlEvent: Constructors and Destructor
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -346,6 +361,14 @@ tCIDLib::TBoolean TKrnlEvent::bOpen()
}


tCIDLib::TBoolean TKrnlEvent::bPulse()
{
// <TBD>
TKrnlError::SetLastKrnlError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


tCIDLib::TBoolean TKrnlEvent::bReset()
{
if (!m_hevThis.bIsValid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,3 +869,36 @@ TKrnlExtProcess::bWaitForDeath( tCIDLib::TBoolean& bState
}


tCIDLib::TBoolean TKrnlExtProcess::bWaitInit(const tCIDLib::TCard4 c4WaitFor)
{
// <TBD>
TKrnlError::SetLastKrnlError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


tCIDLib::TVoid
TKrnlExtProcess::FormatAttachData( tCIDLib::TCh* const pszToFill
, const tCIDLib::TCard4 c4MaxChars)
{
// <TBD>
TKrnlError::SetLastKrnlError(kKrnlErrs::errcGen_NotSupported);
}


tCIDLib::TProcessId TKrnlExtProcess::pidThis() const
{
// Get the running state. If it fails, return the invalid handle
tCIDLib::TBoolean bRun;
if (!bIsRunning(bRun))
return kCIDLib::pidInvalid;

// If not running, also return the invalid handle
if (!bRun)
return kCIDLib::pidInvalid;

// Looks ok, so return the id
return m_hprocThis.m_phprociThis->pidThis;
}


129 changes: 129 additions & 0 deletions Source/AllProjects/CIDKernel/Linux/CIDKernel_FileSystem_Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,135 @@ tCIDLib::TBoolean TKrnlDirSearch::bSearchIsOpen() const



// ---------------------------------------------------------------------------
// CLASS: TKrnlDirChangeInfo
// PREFIX: kdchi
// ---------------------------------------------------------------------------

// ---------------------------------------------------------------------------
// TKrnlDirChangeInfo: Constructors and Destructor
// ---------------------------------------------------------------------------
TKrnlDirChangeInfo::TKrnlDirChangeInfo() :

m_eChange(tCIDLib::EDirChanges::None)
{
}


// ---------------------------------------------------------------------------
// TKrnlDirChangeInfo: Public operators
// ---------------------------------------------------------------------------
TKrnlDirChangeInfo& TKrnlDirChangeInfo::operator=(const TKrnlDirChangeInfo& kdchiSrc)
{
if (&kdchiSrc != this)
{
m_eChange = kdchiSrc.m_eChange;
m_kstrName = kdchiSrc.m_kstrName;
m_kstrNew = kdchiSrc.m_kstrNew;
}
return *this;
}



// ---------------------------------------------------------------------------
// CLASS: TKrnlDirChangeMon
// PREFIX: kdchm
// ---------------------------------------------------------------------------

// ---------------------------------------------------------------------------
// TKrnlDirChangeMon: Public data
// ---------------------------------------------------------------------------
constexpr tCIDLib::TCard4 c4DirMonBufSz = 32 * 1024;
struct TKrnlDirChangeMon::TDirChangeMonitorData
{
int empty; // <TBD>
};


// ---------------------------------------------------------------------------
// TKrnlDirChangeMon: Constructors and Destructor
// ---------------------------------------------------------------------------
TKrnlDirChangeMon::TKrnlDirChangeMon() :

m_bDoSubDirs(kCIDLib::False)
, m_eFilters(tCIDLib::EDirChFilters::None)
, m_pData(nullptr)
{
// Allocate our internal structure
m_pData = new TDirChangeMonitorData{0};
}

TKrnlDirChangeMon::~TKrnlDirChangeMon()
{
// Clean up our data if not already
if (m_pData)
{
bCleanup();
delete m_pData;
m_pData = nullptr;
}
}


// ---------------------------------------------------------------------------
// TKrnlDirChangeMon: Public, non-virtual methods
// ---------------------------------------------------------------------------

// Do a cancel on the directory handle, to break out any thread that is blocked on it
tCIDLib::TBoolean TKrnlDirChangeMon::bCancel()
{
// <TBD>
TKrnlError::SetLastError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


// Clean up anything that got created
tCIDLib::TBoolean TKrnlDirChangeMon::bCleanup()
{
m_bDoSubDirs = kCIDLib::False;
m_eFilters = tCIDLib::EDirChFilters::None;
m_kstrTargetDir.Clear();
return kCIDLib::True;
}



// Indicate whether we currently are monitoring or not
tCIDLib::TBoolean TKrnlDirChangeMon::bIsReady() const
{
// <TBD>
TKrnlError::SetLastError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


tCIDLib::TBoolean
TKrnlDirChangeMon::bReadChanges(TChangeList& kllstToFill, tCIDLib::TCard4& c4ValidCnt)
{
// Make sure we return zero unless proven otherwise
c4ValidCnt = 0;

// <TBD>
TKrnlError::SetLastError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


tCIDLib::TBoolean
TKrnlDirChangeMon::bStartMonitor(const tCIDLib::TCh* const pszTargetDir
, const tCIDLib::EDirChFilters eFilters
, const tCIDLib::TBoolean bDoSubDirs)
{
// <TBD>
TKrnlError::SetLastError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}




// ---------------------------------------------------------------------------
// TKrnlFileSys functions
// ---------------------------------------------------------------------------
Expand Down
41 changes: 40 additions & 1 deletion Source/AllProjects/CIDKernel/Linux/CIDKernel_File_Linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ tCIDLib::TBoolean TKrnlFile::bClose()
}


tCIDLib::TBoolean TKrnlFile::bFlush()
{
if (::fsync(m_hflThis.m_phfliThis->iFd))
{
TKrnlError::SetLastHostError(errno);
return kCIDLib::False;
}
return kCIDLib::True;
}


tCIDLib::TBoolean TKrnlFile::bQueryCurSize(tCIDLib::TCard8& c8ToFill) const
{
struct stat StatBuf;
Expand Down Expand Up @@ -499,6 +510,20 @@ TKrnlFile::bReadBuffer( tCIDLib::TVoid* const pBuffer
}


tCIDLib::TBoolean
TKrnlFile::bReadBufferTO( tCIDLib::TVoid* const pBuffer
, const tCIDLib::TCard4 c4ToRead
, tCIDLib::TCard4& c4BytesRead
, const tCIDLib::TCard4 c4MaxWait
, TKrnlEvent& kevToPost)
{
// <TBD>
c4BytesRead = 0;
TKrnlError::SetLastError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}


tCIDLib::TBoolean TKrnlFile::bSetFilePointer(const tCIDLib::TCard8& c8ToSet)
{
//
Expand All @@ -509,7 +534,7 @@ tCIDLib::TBoolean TKrnlFile::bSetFilePointer(const tCIDLib::TCard8& c8ToSet)
off_t offActualPos = c8ToSet;
tCIDLib::TSInt iSeekType = SEEK_SET;

if (c8ToSet == kCIDLib::c4MaxCard)
if (c8ToSet == kCIDLib::c8MaxCard)
{
offActualPos = 0;
iSeekType = SEEK_END;
Expand Down Expand Up @@ -629,3 +654,17 @@ TKrnlFile::bWriteBuffer(const tCIDLib::TVoid* const pBuffer

return kCIDLib::True;
}


tCIDLib::TBoolean
TKrnlFile::bWriteBufferTO( const tCIDLib::TVoid* const pBuffer
, const tCIDLib::TCard4 c4ToWrite
, tCIDLib::TCard4& c4BytesWritten
, const tCIDLib::TCard4 c4MaxWait
, TKrnlEvent& kevToPost)
{
// <TBD>
c4BytesWritten = 0;
TKrnlError::SetLastError(kKrnlErrs::errcGen_NotSupported);
return kCIDLib::False;
}
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ tCIDLib::TBoolean TKrnlLinux::TThreadTimer::bTriggered() const

tCIDLib::TVoid TKrnlLinux::TThreadTimer::Cancel()
{
::pthread_cancel(m_tidThis);
if (m_tidThis != kCIDLib::tidInvalid)
{
::pthread_cancel(m_tidThis);
}
}

sigjmp_buf& TKrnlLinux::TThreadTimer::JumpEnvironment() const
Expand Down
Loading