Skip to content

Commit d547426

Browse files
authored
feat: add compatibility support for QNX Neutrino (#248)
1 parent d615f1b commit d547426

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

loader/icd_platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef _ICD_PLATFORM_H_
2020
#define _ICD_PLATFORM_H_
2121

22-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
22+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__QNXNTO__)
2323

2424
#define PATH_SEPARATOR ':'
2525
#define DIRECTORY_SYMBOL '/'

loader/linux/icd_linux.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ static inline void khrIcdOsDirEnumerate(const char *path, const char *env,
187187
break;
188188
memcpy(nameCopy, dirEntry->d_name, sz);
189189
dirElems[elemCount].d_name = nameCopy;
190+
#if defined(__QNXNTO__)
191+
dirElems[elemCount].d_type = _DEXTRA_FIRST(dirEntry)->d_type;
192+
#else
190193
dirElems[elemCount].d_type = dirEntry->d_type;
194+
#endif
191195
elemCount++;
192196
}
193197
qsort(dirElems, elemCount, sizeof(struct dirElem), compareDirElem);

loader/linux/icd_linux_envvars.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ char *khrIcd_getenv(const char *name) {
3232
}
3333

3434
char *khrIcd_secure_getenv(const char *name) {
35-
#if defined(__APPLE__)
35+
#if defined(__APPLE__) || defined(__QNXNTO__)
3636
// Apple does not appear to have a secure getenv implementation.
3737
// The main difference between secure getenv and getenv is that secure getenv
3838
// returns NULL if the process is being run with elevated privileges by a normal user.

0 commit comments

Comments
 (0)