Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mtsas mtsas thermostat_fan_demo--fan mtsas ... more
NOTE: MTS-Utils has moved to GitHub. This version will not be updated. For updates, go to the GitHub version.
Revision 11:4f4966954da9, committed 2015-01-23
- Comitter:
- Mike Fiore
- Date:
- Fri Jan 23 16:53:33 2015 -0600
- Parent:
- 10:d1a3f03f093f
- Child:
- 12:7818d55b35c6
- Commit message:
- define mts_min/mts_max inline functions instead of MIN/MAX macros - macros break in IAR
Changed in this revision
| Utils.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Utils.h Wed Jul 16 14:24:00 2014 +0000
+++ b/Utils.h Fri Jan 23 16:53:33 2015 -0600
@@ -4,14 +4,10 @@
#include <string>
//Defines a max function that can be used.
-#ifndef MAX
-#define MAX(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a > _b ? _a : _b; })
-#endif
+inline int mts_max(int a, int b) { return a > b ? a : b; }
//Defines a min function that can be used.
-#ifndef MIN
-#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
-#endif
+inline int mts_min(int a, int b) { return a < b ? a : b; }
///An enumeration for relational operators
enum RelationalOperator {