aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCNLohr <lohr85@gmail.com>2017-03-17 01:18:05 -0400
committerCNLohr <lohr85@gmail.com>2017-03-17 01:19:00 -0400
commit47d2e48cdb9d894e011fd02ed18486adefc49c72 (patch)
treeabd1406972bab21d075a5e14404004fc7dee9932
parent5cc41bddc37f8ed116575dddab34b514a417c883 (diff)
downloadlibsurvive-47d2e48cdb9d894e011fd02ed18486adefc49c72.tar.gz
libsurvive-47d2e48cdb9d894e011fd02ed18486adefc49c72.tar.bz2
Fix TCC compile.
-rw-r--r--include/libsurvive/survive.h12
-rw-r--r--redist/json_helpers.c2
2 files changed, 3 insertions, 11 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 28180e4..e04586c 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -138,7 +138,7 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
void RegisterDriver(const char * name, void * data);
-#ifdef _WIN32
+#ifdef _MSC_VER
#define REGISTER_LINKTIME( func ) \
__pragma(comment(linker,"/export:REGISTER"#func));\
void REGISTER##func() { RegisterDriver(#func, &func); }
@@ -157,22 +157,14 @@ void survive_add_driver( SurviveContext * ctx, void * payload, DeviceDriverCb po
//For lightcap, etc. Don't change this structure at all. Regular vive is dependent on it being exactly as-is.
//When you write drivers, you can use this to send survive lightcap data.
-#ifdef _WIN32
-#pragma pack(push,1)
-#endif
typedef struct
{
uint8_t sensor_id;
uint16_t length;
uint32_t timestamp;
}
-#ifdef __linux__
-__attribute__((packed))
-#endif
LightcapElement;
-#ifdef _WIN32
-#pragma pack(pop)
-#endif
+
//This is the disambiguator function, for taking light timing and figuring out place-in-sweep for a given photodiode.
void handle_lightcap( SurviveObject * so, LightcapElement * le );
diff --git a/redist/json_helpers.c b/redist/json_helpers.c
index 1e2f43e..115076e 100644
--- a/redist/json_helpers.c
+++ b/redist/json_helpers.c
@@ -11,7 +11,7 @@
#include <malloc.h>
#endif
-#ifdef _WIN32
+#ifdef _MSC_VER
#include <stdarg.h>
// Windows doesn't provide asprintf, so we need to make it.