Index: libcxx/trunk/include/__config =================================================================== --- libcxx/trunk/include/__config +++ libcxx/trunk/include/__config @@ -626,6 +626,12 @@ #endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM] #if defined(_LIBCPP_OBJECT_FORMAT_COFF) +#ifdef _DLL +# define _LIBCPP_CRT_FUNC __declspec(dllimport) +#else +# define _LIBCPP_CRT_FUNC +#endif + #if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) # define _LIBCPP_DLL_VIS # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS Index: libcxx/trunk/src/support/runtime/exception_msvc.ipp =================================================================== --- libcxx/trunk/src/support/runtime/exception_msvc.ipp +++ libcxx/trunk/src/support/runtime/exception_msvc.ipp @@ -15,30 +15,18 @@ #include #include -#if !defined(_ACRTIMP) -#define _ACRTIMP __declspec(dllimport) -#endif - -#if !defined(_VCRTIMP) -#define _VCRTIMP __declspec(dllimport) -#endif - -#if !defined(__CRTDECL) -#define __CRTDECL __cdecl -#endif - extern "C" { -typedef void (__CRTDECL* terminate_handler)(); -_ACRTIMP terminate_handler __cdecl set_terminate( +typedef void (__cdecl* terminate_handler)(); +_LIBCPP_CRT_FUNC terminate_handler __cdecl set_terminate( terminate_handler _NewTerminateHandler) throw(); -_ACRTIMP terminate_handler __cdecl _get_terminate(); +_LIBCPP_CRT_FUNC terminate_handler __cdecl _get_terminate(); -typedef void (__CRTDECL* unexpected_handler)(); -_VCRTIMP unexpected_handler __cdecl set_unexpected( +typedef void (__cdecl* unexpected_handler)(); +_LIBCPP_CRT_FUNC unexpected_handler __cdecl set_unexpected( unexpected_handler _NewUnexpectedHandler) throw(); -_VCRTIMP unexpected_handler __cdecl _get_unexpected(); +_LIBCPP_CRT_FUNC unexpected_handler __cdecl _get_unexpected(); -_VCRTIMP int __cdecl __uncaught_exceptions(); +_LIBCPP_CRT_FUNC int __cdecl __uncaught_exceptions(); } namespace std { Index: libcxx/trunk/src/support/runtime/exception_pointer_msvc.ipp =================================================================== --- libcxx/trunk/src/support/runtime/exception_pointer_msvc.ipp +++ libcxx/trunk/src/support/runtime/exception_pointer_msvc.ipp @@ -11,30 +11,16 @@ #include #include -#if !defined(_CRTIMP2_PURE) -#define _CRTIMP2_PURE __declspec(dllimport) -#endif - -#if !defined(__CLRCALL_PURE_OR_CDECL) -#define __CLRCALL_PURE_OR_CDECL __cdecl -#endif - -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(void*, - const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL -__ExceptionPtrAssign(void*, const void*); -_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL -__ExceptionPtrCompare(const void*, const void*); -_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL -__ExceptionPtrToBool(const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(void*, void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL -__ExceptionPtrCurrentException(void*); -[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL -__ExceptionPtrRethrow(const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCreate(void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrDestroy(void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopy(void*, const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrAssign(void*, const void*); +_LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrCompare(const void*, const void*); +_LIBCPP_CRT_FUNC bool __cdecl __ExceptionPtrToBool(const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrSwap(void*, void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCurrentException(void*); +[[noreturn]] _LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrRethrow(const void*); +_LIBCPP_CRT_FUNC void __cdecl __ExceptionPtrCopyException(void*, const void*, const void*); namespace std {