Unified approach for determining the enthalpic fictive temperature of glasses with arbitrary thermal history