From b2f6707efc2ce5e639671551060da62f878b799a Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Tue, 3 Dec 2024 22:51:50 -0600 Subject: [PATCH] Update norm.h to be safe --- include/klein/norm.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/klein/norm.h b/include/klein/norm.h index bca38f3..72b1729 100644 --- a/include/klein/norm.h +++ b/include/klein/norm.h @@ -1,3 +1,16 @@ +#ifdef KLEIN_NORM_H +#error file included twice +#endif +#define KLEIN_NORM_H + + +#ifndef KLEIN_H +#warning Please include klein/klein.h +#endif + +void klein_normalize(struct klein * klein); + +#ifdef KLEIN_IMPLEMENT static inline void __calculate_normal( float *p1, float *p2, float *p3, float *normal, unsigned char n) { unsigned char i; @@ -116,3 +129,4 @@ void klein_normalize(struct klein * klein) free(norm_vec); } +#endif