Skip to content

Commit

Permalink
Add OSX build and fix errors with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
cgmb committed Jan 25, 2020
1 parent f2ece50 commit 39cd2f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
@@ -1,9 +1,13 @@
language: c
sudo: required
dist: bionic

compiler:
- gcc
- clang

os:
- linux
- osx
dist: bionic
osx_image: xcode9.4

script: cmake -H. -Bbuild && cmake --build build
8 changes: 4 additions & 4 deletions math/vec2f.h
Expand Up @@ -5,25 +5,25 @@ typedef struct vec2f {
float y;
} vec2f;

inline vec2f mulf_v2f(float s, vec2f v) {
static inline vec2f mulf_v2f(float s, vec2f v) {
v.x *= s;
v.y *= s;
return v;
}

inline vec2f add_v2f(vec2f a, vec2f b) {
static inline vec2f add_v2f(vec2f a, vec2f b) {
a.x += b.x;
a.y += b.y;
return a;
}

inline vec2f sub_v2f(vec2f a, vec2f b) {
static inline vec2f sub_v2f(vec2f a, vec2f b) {
a.x -= b.x;
a.y -= b.y;
return a;
}

inline vec2f make_v2f(float x, float y) {
static inline vec2f make_v2f(float x, float y) {
vec2f v = {x, y};
return v;
}
10 changes: 5 additions & 5 deletions misc/cmp.h
Expand Up @@ -2,22 +2,22 @@

#include <stdint.h>

inline float min_f(float a, float b) {
static inline float min_f(float a, float b) {
return a < b ? a : b;
}

inline float max_f(float a, float b) {
static inline float max_f(float a, float b) {
return a < b ? b : a;
}

inline int min_i(int a, int b) {
static inline int min_i(int a, int b) {
return a < b ? a : b;
}

inline int max_i(int a, int b) {
static inline int max_i(int a, int b) {
return a < b ? b : a;
}

inline uint8_t min_u8(uint8_t a, uint8_t b) {
static inline uint8_t min_u8(uint8_t a, uint8_t b) {
return a < b ? a : b;
}

0 comments on commit 39cd2f0

Please sign in to comment.