Notice»

Recent Post»

Recent Comment»

Recent Trackback»

Archive»

« 2024/3 »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

time_t(VC6 -> VC8) - 081117

버그리포트 | 2009. 8. 21. 20:08 | Posted by 99%

요점부터 말씀드리면

VC6의 time_t가 long형으로 디파인 되어있는데요.

VC8에선 요놈이 __int64이더라구요 ㅡ.ㅡ; 잘돌아가던 소스가 갑자기... ㅡ.ㅡ;


// 임시 해결방법(아래껄 디파인하면 32비트형으로 쓸수 있음)

_USE_32BIT_TIME_T
In versions of Visual C++ and Microsoft C/C++ before Visual C++ 2005, time_t was a long int (32 bits) and hence could not be used for dates past 3:14:07 January 19, 2038, UTC. In Visual C++ 2005, time_t is equivalent to __time64_t by default, but defining _USE_32BIT_TIME_T changes time_t to __time32_t and forces many time functions to call versions that take the 32-bit time_t. For more information, see Standard Types and comments in the documentation for the individual time functions.


c:\Program Files\Microsoft Visual Studio\VC98\Include\TIME.H

#ifndef _TIME_T_DEFINED
typedef long time_t;        /* time value */
#define _TIME_T_DEFINED     /* avoid multiple def's of time_t */
#endif


////////////////////////////////////////////////////////////////////////////

c:\program files\microsoft visual studio 8\vc\include\crtdefs.h
#ifndef _TIME64_T_DEFINED
#if     _INTEGRAL_MAX_BITS >= 64
typedef __int64 __time64_t;     /* 64-bit time value */
#endif
#define _TIME64_T_DEFINED
#endif


DLL과 연결된 콜백함수였는데.. time_t인자 이후로는 값이 이상하게 전달되서 오늘 하루 완전

별짓을 다했네요 ㅎㅎ

에러도 안나구요. 아무 문제없이 컴파일 됩니다. 다만 늘어난 자료형에 따라 그뒤에 변수들 값이 4바이트메모리 만큼 밀린곳의 값을 가져오더라구요 ㅡ.ㅡ;;;;;;;; 맨마지막 변수는 쓰레기값;;

제가 찾은 몇개 사용법및 주의 사항 링크입니다. 이런거로 삽질하지 맙시다;;윽; ㅋ


Visual C++ 2005의 CRT 기능(MSDN)

-> time_t의 기본 크기가 이제 64비트입니다. 이는 3000년까지만 처리하는 여러 가지 시간 함수와 time_t의 범위를 확장한 것입니다. :Track('ctl00_rs1_mainContentContainer_cpe355591_c|ctl00_rs1_mainContentContainer_ctl81',this);" href="http://msdn.microsoft.com/ko-kr/library/w4ddyt9h.aspx">시간 관리 및 개별 시간 함수를 참조하십시오.

http://msdn.microsoft.com/ko-kr/library/ms235429.aspx

 

time_t 와 InterlockedExchange 사용금지 (Visual Studio 2005 변경)

http://a.tk.co.kr/entry/timet-%EC%99%80-InterlockedExchange-%EC%82%AC%EC%9A%A9%EA%B8%88%EC%A7%80-Visual-Studio-2005-%EB%B3%80%EA%B2%BD


: