Skip to content

Instantly share code, notes, and snippets.

@2bbb
Created March 24, 2016 11:53
Show Gist options
  • Save 2bbb/1465ad832e765848d126 to your computer and use it in GitHub Desktop.
Save 2bbb/1465ad832e765848d126 to your computer and use it in GitHub Desktop.
OFX_VERSION_MACRO
#pragma once
#include "ofConstants.h"
#define OFX_MAKE_OF_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch)
#define OFX_THIS_OF_VERSION OFX_MAKE_OF_VERSION(OF_VERSION_MAJOR, OF_VERSION_MINOR, OF_VERSION_PATCH)
#define OFX_THIS_OF_IS_OLDER_THAN(major, minor, patch) (OFX_OF_VERSION < OFX_MAKE_OF_VERSION(major, minor, patch))
#define OFX_THIS_OF_IS_OLDER_THAN_EQ(major, minor, patch) (OFX_OF_VERSION <= OFX_MAKE_OF_VERSION(major, minor, patch))
#define OFX_THIS_OF_IS_NEWER_THAN(major, minor, patch) (OFX_MAKE_OF_VERSION(major, minor, patch) < OFX_OF_VERSION)
#define OFX_THIS_OF_IS_NEWER_THAN_EQ(major, minor, patch) (OFX_MAKE_OF_VERSION(major, minor, patch) <= OFX_OF_VERSION)
// ex.
#define IS_THREAD_CHANNEL_MOVE_CORRECT OFX_THIS_OF_IS_NEWER_THAN(0, 9, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment