Make vec.h const-correct with both C and C++
C and C++ have different semantics for const if a function parameter has
multiple indirections (e.g., a double pointer or a 2D array). If such a
parameter is not modified by the function, it is tricky to write
const-correct code using such functions:
- If the parameter is declared const, then C will give a warning if a
non-const value is passed.
- If the parameter is not declared const, then C++ will give an error
if a const value is passed.
Added a macro that allows using a single declaration in vec.h for
functions that take matrix values as input parameters, and still making
it possible to pass both non-const and const values to such parameters
in both C and C++.
Change-Id: Ifca3ff6842489c3a1040a8261ba429d96409fc21