The compiler and linker is usually determined by the file extension if not set otherwise. So as long as the file endings are fine, your code is compiled and linked with the correct compiler.
On a side note, remember to make the correct extern C declarations, if you mix C and C++.