Compilation fix on OSX / Windows
This commit is contained in:
@@ -363,7 +363,7 @@ dev_from_mount_options (char const *mount_options)
|
||||
/* GNU/Linux allows file system implementations to define their own
|
||||
meaning for "dev=" mount options, so don't trust the meaning
|
||||
here. */
|
||||
# ifndef __linux__
|
||||
#ifndef __linux__
|
||||
static char const dev_pattern[] = ",dev=";
|
||||
char const *devopt = strstr (mount_options, dev_pattern);
|
||||
|
||||
|
||||
+11
-5
@@ -28,7 +28,6 @@ extern "C++" {
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
@@ -113,11 +112,20 @@ extern "C++" {
|
||||
|
||||
#define TASK_FUNCTION(task) void * task(void * pdata)
|
||||
|
||||
template<int SIZE>
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * task(void *), const char * name, FakeTaskStack<SIZE> &, unsigned, unsigned)
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * task(void *), const char * name)
|
||||
{
|
||||
pthread_create(&taskId, nullptr, task, nullptr);
|
||||
#ifdef __linux__
|
||||
pthread_setname_np(taskId, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int SIZE>
|
||||
inline void RTOS_CREATE_TASK(pthread_t &taskId, void * task(void *), const char * name, FakeTaskStack<SIZE> &, unsigned size = 0, unsigned priority = 0)
|
||||
{
|
||||
UNUSED(size);
|
||||
UNUSED(priority);
|
||||
RTOS_CREATE_TASK(taskId, task, name);
|
||||
}
|
||||
|
||||
#define TASK_RETURN() return nullptr
|
||||
@@ -138,9 +146,7 @@ extern "C++" {
|
||||
{
|
||||
return (uint32_t)(simuTimerMicros() / 1000);
|
||||
}
|
||||
|
||||
#elif defined(RTOS_COOS)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -386,7 +386,9 @@ void StartAudioThread(int volumeGain)
|
||||
sp.sched_priority = SCHED_RR;
|
||||
pthread_attr_setschedparam(&attr, &sp);
|
||||
pthread_create(&simuAudio.threadPid, &attr, &audioThread, nullptr);
|
||||
#ifdef __linux__
|
||||
pthread_setname_np(simuAudio.threadPid, "audio");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ void eepromSimuWriteBlock(uint8_t * buffer, size_t address, size_t size)
|
||||
volatile uint8_t eepromTransferComplete = 1;
|
||||
void * eeprom_thread_function(void *)
|
||||
{
|
||||
eeprom_thread_running = true;
|
||||
|
||||
while (!sem_wait(eeprom_write_sem)) {
|
||||
if (!eeprom_thread_running)
|
||||
return nullptr;
|
||||
@@ -85,7 +87,8 @@ void * eeprom_thread_function(void *)
|
||||
}
|
||||
eepromTransferComplete = 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8_t eepromReadStatus()
|
||||
@@ -162,13 +165,7 @@ void StartEepromThread(const char * filename)
|
||||
sem_init(eeprom_write_sem, 0, 0);
|
||||
#endif
|
||||
|
||||
if (!pthread_create(&eeprom_thread_pid, nullptr, &eeprom_thread_function, nullptr)) {
|
||||
pthread_setname_np(eeprom_thread_pid, "eeprom");
|
||||
eeprom_thread_running = true;
|
||||
}
|
||||
else {
|
||||
perror("Could not create eeprom thread.");
|
||||
}
|
||||
RTOS_CREATE_TASK(eeprom_thread_pid, eeprom_thread_function, "eeprom");
|
||||
}
|
||||
|
||||
void StopEepromThread()
|
||||
|
||||
Reference in New Issue
Block a user