Changeset 1159


Ignore:
Timestamp:
Mar 12, 2012, 3:04:14 PM (10 years ago)
Author:
sam
Message:

math: disable annoying compiler warnings in vector.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/vector.h

    r1158 r1159  
    12331233DECLARE_ALL_VECTOR_OPS(Vec4)
    12341234
     1235/* Disable warnings in the >= > etc. operators about comparing signed and
     1236 * unsigned. Ideally we would like to get these warnings only when the
     1237 * inlined operators are actually used, but they seem to be triggered at
     1238 * the code parsing step, so the compiler does not yet know whether they
     1239 * will be used.
     1240 * Also we do this for the whole block of declarations, because GCC prior
     1241 * to 4.6.3 does not appear to support _Pragma() inside a macro. */
     1242#if defined __GNUC__ && (__GNUC__ >= 4)
     1243#   pragma GCC diagnostic push
     1244#   pragma GCC diagnostic ignored "-Wsign-compare"
     1245#elif defined _MSC_VER
     1246#   pragma warning(push)
     1247#   pragma warning(disable: 4018)
     1248#endif
     1249
    12351250DECLARE_ALL_VECTOR_COERCE_OPS(Vec2)
    12361251DECLARE_ALL_VECTOR_COERCE_OPS(Vec3)
    12371252DECLARE_ALL_VECTOR_COERCE_OPS(Vec4)
     1253
     1254#if defined __GNUC__ && (__GNUC__ >= 4)
     1255#   pragma GCC diagnostic pop
     1256#elif defined _MSC_VER
     1257#   pragma warning(pop)
     1258#endif
    12381259
    12391260#undef DECLARE_VECTOR_TYPEDEFS
Note: See TracChangeset for help on using the changeset viewer.