根據(jù)我對(duì)msvc系列和mingw編譯器的了解
具體差異如下:
1.在編譯源文件過(guò)程中,2者對(duì)涉及的相關(guān)頭文件有所不同
比如:
#ifdef G_MSVC
#include <GEngine/Template/Vector.hpp>
#endif
這是蓋莫引擎中math.hpp包含的頭文件
其中有一個(gè)函數(shù):
////////////////////////////////////////////////////////
/// 給定差量t(0<=t<=1)獲取線性插值點(diǎn)p(0) = p1,p(1) = p2
////////////////////////////////////////////////////////
template<class T>
static Vector3<T> GetPoint(const Vector3<T> &from,const Vector3<T> &to,float t);
在編譯的Math的時(shí)候MinGW需要先"編譯"Vector文件
2.2者在處理函數(shù)返回值上的不同
比如:
int GetValue()
{
}
msvc需要顯式的給定函數(shù)返回值
而mingw不需要(具有默認(rèn)值)
3.對(duì)待函數(shù)參數(shù)的不同
比如
template<class T>
void Add(T a,T a);
4.基本數(shù)據(jù)結(jié)構(gòu)類型有所不同
5.在獲取原始數(shù)據(jù)上的區(qū)別如下:
const int MAXINT = std::numeric_limits<int>::max;
const double MAXDOUBLE = (std::numeric_limits<double>::max)();
6.其他請(qǐng)大家補(bǔ)充吧