From 45b8913a257c2066adf01637cc5778fdb36e3327 Mon Sep 17 00:00:00 2001 From: HerrNamenlos123 Date: Wed, 21 Oct 2026 16:24:44 +1100 Subject: [PATCH] ofxAccelerometer: memset instead of bzero bzero is POSIX-only and isn't available with MSVC. memset (from ) clears the matrix the same way on every platform. From openframeworks/openFrameworks#7524. Co-authored-by: Dan Rosser --- addons/ofxAccelerometer/src/ofxAccelerometer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/ofxAccelerometer/src/ofxAccelerometer.h b/addons/ofxAccelerometer/src/ofxAccelerometer.h index ed25ebabf99..e07e30b5f89 100644 --- a/addons/ofxAccelerometer/src/ofxAccelerometer.h +++ b/addons/ofxAccelerometer/src/ofxAccelerometer.h @@ -36,6 +36,8 @@ #include "ofEvents.h" #include "ofMathConstants.h" +#include + typedef void (*ofxAccelCB)(ofPoint&); // typedef for accelerometer callback class ofxAccelerometerHandler { @@ -159,7 +161,7 @@ class ofxAccelerometerHandler { if(length < 0.1) return; //Clear matrix to be used to rotate from the current referential to one based on the gravity vector - bzero(matrix, sizeof(matrix)); + memset(matrix, 0, sizeof(matrix)); matrix[3][3] = 1.0; //Setup first matrix column as gravity vector