mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-26 11:07:57 +00:00
Make sure not to break compilation if we don't have any atomics.
This commit is contained in:
parent
0ecd678a58
commit
c8101b46f7
1 changed files with 18 additions and 0 deletions
|
@ -186,6 +186,7 @@ static double CompressImageInSerial(
|
|||
return cmpTime;
|
||||
}
|
||||
|
||||
#ifdef HAS_ATOMICS
|
||||
class AtomicThreadUnit : public TCCallable {
|
||||
CompressionJobList &m_CompressionJobList;
|
||||
TCBarrier *m_Barrier;
|
||||
|
@ -269,6 +270,16 @@ static double CompressImageWithAtomics(
|
|||
double cmpTimeTotal = sw.TimeInMilliseconds();
|
||||
return cmpTimeTotal / double(settings.iNumCompressions);
|
||||
}
|
||||
#else // HAS_ATOMICS
|
||||
static double CompressImageWithAtomics(
|
||||
const unsigned char *imgData,
|
||||
const unsigned int width, const unsigned int height,
|
||||
const SCompressionSettings &settings,
|
||||
unsigned char *outBuf
|
||||
) {
|
||||
fprintf(stderr, "Compiler does not support atomic operations!");
|
||||
}
|
||||
#endif
|
||||
|
||||
static double CompressThreadGroup(ThreadGroup &tgrp, const SCompressionSettings &settings) {
|
||||
if(!(tgrp.PrepareThreads())) {
|
||||
|
@ -419,6 +430,13 @@ bool CompressImageData(
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAS_ATOMICS
|
||||
if(settings.bUseAtomics) {
|
||||
ReportError("Compiler's atomic operations are not supported!\n");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(dataSz <= 0) {
|
||||
ReportError("No data sent to compress!");
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue