diff --git a/include/library.h b/include/library.h
index 1edd3757..377dd8ae 100644
--- a/include/library.h
+++ b/include/library.h
@@ -36,7 +36,7 @@
 #ifndef LIBBC_PRIVATE_H
 #define LIBBC_PRIVATE_H
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__luna__)
 
 #include <pthread.h>
 
@@ -386,10 +386,14 @@ typedef struct BclCtxt
 BcVm*
 bcl_getspecific(void);
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__luna__)
 
 typedef pthread_key_t BclTls;
 
+#elif __luna__
+
+typedef int BclTls;
+
 #else // _WIN32
 
 typedef DWORD BclTls;