OSDN Git Service

[VM][General][Qt] Merge upstream 2015-12-31.
[csp-qt/common_source_project-fm7.git] / source / src / common.h
index be96e27..1c2d81f 100644 (file)
        #else
                // Windows, but not VC++
                #define SUPPORT_TCHAR_TYPE
-//             #define SUPPORT_SECURE_FUNCTIONS
        #endif
- #endif
+#endif
 
-// disable warnings  for microsoft visual c++ 2005 or later
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-#pragma warning( disable : 4819 )
-//#pragma warning( disable : 4995 )
-#pragma warning( disable : 4996 )
+// secure functions need tchar type
+#ifndef SUPPORT_TCHAR_TYPE
+#undef SUPPORT_SECURE_FUNCTIONS
 #endif
 
+
 // endian
 #if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
        #if defined(__BYTE_ORDER) && (defined(__LITTLE_ENDIAN) || defined(__BIG_ENDIAN))
@@ -377,6 +375,9 @@ typedef union {
        #ifndef _tcstok
                #define _tcstok strtok
        #endif
+       #ifndef _tstoi
+               #define _tstoi atoi
+       #endif
        #ifndef _tcstol
                #define _tcstol strtol
        #endif
@@ -450,7 +451,9 @@ typedef union {
 
 
 // rgb color
-#define _RGB888
+#if !defined(_RGB555) && !defined(_RGB565) && !defined(_RGB888)
+       #define _RGB888
+#endif
 
 #if defined(_RGB555) || defined(_RGB565)
        typedef uint16 scrntype;
@@ -577,6 +580,7 @@ bool check_file_extension(const _TCHAR* file_path, const _TCHAR* ext);
 _TCHAR *get_file_path_without_extensiton(const _TCHAR* file_path);
 
 uint32 getcrc32(uint8 data[], int size);
+uint16 jis_to_sjis(uint16 jis);
 
 
 #define array_length(array) (sizeof(array) / sizeof(array[0]))