2014-04-02 13:52 GMT+02:00 Mason <[email protected]>: > > Would it be possible to define MIN and MAX as inline functions? > > static inline int MIN(int a, int b) { return a < b ? a : b; }
Macros accept any comparable type, so you would have to have specific functions for int, unsigned, double etc. 2014-04-02 12:07 GMT+02:00 Denys Vlasenko <[email protected]>: > typeof() is GCCism. I am wary of using it unless it's necessary. # find | egrep "\.[ch]$" | xargs grep "typeof" ./coreutils/sleep.c: ts.tv_sec = MAXINT(typeof(ts.tv_sec)) Typeof() is already used here and there are many other GCCisms all over the place anyway. Best regards, Bartosz Golaszewski _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
