Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#ifndef igs_resource_msg_from_err_h
Toshihiro Shimizu 890ddd
#define igs_resource_msg_from_err_h
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <string></string>
Toshihiro Shimizu 890ddd
#include "igs_os_type.h" /* TCHAR,TEXT(),... */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define igs_tostr(n) igs_tostr_(n) /* __LINE__ -->  56   */
Shinya Kitaoka 120a6e
#define igs_tostr_(n) #n           /* 56       --> "56" */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef IGS_RESOURCE_LOG_EXPORT
Toshihiro Shimizu 890ddd
#define IGS_RESOURCE_LOG_EXPORT
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*------ エラーメッセージ表示 --------------------------------------*/
Shinya Kitaoka 120a6e
namespace igs {
Shinya Kitaoka 120a6e
namespace resource {
Toshihiro Shimizu 890ddd
const std::string msg_from_err_(/* 直によんではいけない */
Shinya Kitaoka 120a6e
                                const std::basic_string<tchar> &tit,</tchar>
Shinya Kitaoka 120a6e
                                const int erno, const std::string &file,
Shinya Kitaoka 120a6e
                                const std::string &line,
Shinya Kitaoka 120a6e
                                const std::string &pretty_function,
Shinya Kitaoka 120a6e
                                const std::string &comp_type,
Shinya Kitaoka 120a6e
                                const std::string &gnuc,
Shinya Kitaoka 120a6e
                                const std::string &gnuc_minor,
Shinya Kitaoka 120a6e
                                const std::string &gnuc_patchlevel,
Shinya Kitaoka 120a6e
                                const std::string &gnuc_rh_release,
Shinya Kitaoka 120a6e
                                const std::string &date,
Shinya Kitaoka 120a6e
                                const std::string &time);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
/*--- errno値からエラーメッセージを得る ---*/
Shinya Kitaoka 120a6e
#define igs_resource_msg_from_err(tit, erno)                                   \
Shinya Kitaoka 120a6e
  igs::resource::msg_from_err_(                                                \
Shinya Kitaoka 120a6e
      tit, erno, __FILE__, igs_tostr(__LINE__), __PRETTY_FUNCTION__,           \
Shinya Kitaoka 120a6e
      igs_tostr_(__GNUC__), igs_tostr(__GNUC__), igs_tostr(__GNUC_MINOR__),    \
Shinya Kitaoka 120a6e
      igs_tostr(__GNUC_PATCHLEVEL__), igs_tostr(__GNUC_RH_RELEASE__),          \
Shinya Kitaoka 120a6e
      __DATE__, __TIME__)
Toshihiro Shimizu 890ddd
/*--- エラーメッセージを得る ---*/
Shinya Kitaoka 120a6e
#define igs_resource_msg_from_er(tit)                                          \
Shinya Kitaoka 120a6e
  igs::resource::msg_from_err_(                                                \
Shinya Kitaoka 120a6e
      tit, 0, __FILE__, igs_tostr(__LINE__), __PRETTY_FUNCTION__,              \
Shinya Kitaoka 120a6e
      igs_tostr_(__GNUC__), igs_tostr(__GNUC__), igs_tostr(__GNUC_MINOR__),    \
Shinya Kitaoka 120a6e
      igs_tostr(__GNUC_PATCHLEVEL__), igs_tostr(__GNUC_RH_RELEASE__),          \
Shinya Kitaoka 120a6e
      __DATE__, __TIME__)
Toshihiro Shimizu 890ddd
#endif /* !igs_resource_msg_from_err_h */