2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
#ifndef igs_resource_msg_from_err_h
|
|
|
|
#define igs_resource_msg_from_err_h
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "igs_os_type.h" /* windows.h... */
|
|
|
|
|
|
|
|
#define igs_tostr(n) igs_tostr_(n) /* __LINE__ --> 56 */
|
2016-06-15 18:43:10 +12:00
|
|
|
#define igs_tostr_(n) #n /* 56 --> "56" */
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef IGS_RESOURCE_LOG_EXPORT
|
|
|
|
#define IGS_RESOURCE_LOG_EXPORT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*------ エラーメッセージ表示 --------------------------------------*/
|
2016-06-15 18:43:10 +12:00
|
|
|
namespace igs {
|
|
|
|
namespace resource {
|
2016-03-19 06:57:51 +13:00
|
|
|
const std::string msg_from_err_(/* 直によんではいけない */
|
2016-06-15 18:43:10 +12:00
|
|
|
const std::basic_string<TCHAR> &tit,
|
|
|
|
const DWORD error_message_id,
|
|
|
|
const std::basic_string<TCHAR> &file,
|
|
|
|
const std::basic_string<TCHAR> &line,
|
|
|
|
const std::basic_string<TCHAR> &funcsig,
|
|
|
|
const std::basic_string<TCHAR> &comp_type,
|
|
|
|
const std::basic_string<TCHAR> &msc_full_ver,
|
|
|
|
const std::basic_string<TCHAR> &date,
|
|
|
|
const std::basic_string<TCHAR> &time);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/*--- ::GetLastError()値からエラーメッセージを得る ---*/
|
2017-05-09 00:13:29 +12:00
|
|
|
#ifdef _MSC_VER
|
2017-06-07 00:19:00 +12:00
|
|
|
#define igs_resource_msg_from_err(tit, error_message_id) \
|
|
|
|
igs::resource::msg_from_err_( \
|
|
|
|
tit, error_message_id, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \
|
|
|
|
TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \
|
|
|
|
TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__))
|
|
|
|
/*--- エラーメッセージを得る ---*/
|
|
|
|
#define igs_resource_msg_from_er(tit) \
|
|
|
|
igs::resource::msg_from_err_( \
|
|
|
|
tit, NO_ERROR, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \
|
|
|
|
TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \
|
|
|
|
TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__))
|
2017-05-09 00:13:29 +12:00
|
|
|
#else
|
2017-06-07 00:19:00 +12:00
|
|
|
#define igs_resource_msg_from_err(tit, error_message_id) \
|
|
|
|
igs::resource::msg_from_err_( \
|
|
|
|
tit, error_message_id, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \
|
|
|
|
TEXT(__PRETTY_FUNCTION__), TEXT(__VERSION__), TEXT(__VERSION__), \
|
|
|
|
TEXT(__DATE__), TEXT(__TIME__))
|
|
|
|
/*--- エラーメッセージを得る ---*/
|
|
|
|
#define igs_resource_msg_from_er(tit) \
|
|
|
|
igs::resource::msg_from_err_( \
|
|
|
|
tit, NO_ERROR, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \
|
|
|
|
TEXT(__PRETTY_FUNCTION__), TEXT(__VERSION__), TEXT(__VERSION__), \
|
|
|
|
TEXT(__DATE__), TEXT(__TIME__))
|
2017-05-09 00:13:29 +12:00
|
|
|
#endif
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
#endif /* !igs_resource_msg_from_err_h */
|