Annotation of hatari/Visual.Studio/VisualStudioFix.h, revision 1.1

1.1     ! root        1:  /*
        !             2:   * Hatari - Fix for compliation using Visual Studio 6
        !             3:   *
        !             4:   * This file is distributed under the GNU Public License, version 2 or at
        !             5:   * your option any later version. Read the file gpl.txt for details.
        !             6:   *
        !             7:   * This file tells Visual Studio to ignore a number of relatively minor "warnings" that have found their
        !             8:   * way into the HAtari source. None of the "warnings" will hamper the running or compliation or HAtari 
        !             9:   * but it is possible not addressing them may make it difficult for other developers to be sure of the 
        !            10:   * intentions of the original coders against whos code these warnings are raised.
        !            11:   * As long as the original coder was aware of the warnings and of the implicit result of adding no 
        !            12:   * explicit casts to remove them then things are good.
        !            13:   *
        !            14:   * 2009 Vaughan Kaufman
        !            15:   *
        !            16:   */
        !            17: 
        !            18: #if defined(_VCWIN_)                                   // Stop Visual Studio complaining about all the implicit type conversions (wish we would make them explict guys/girls)
        !            19:        #pragma warning (disable:4244)          // conversion with potential data loss
        !            20:        #pragma warning (disable:4761)          // integral size mismatch in argument
        !            21:        #pragma warning (disable:4146)          // unary minus operator applied to unsigned type
        !            22:        #pragma warning (disable:4018)          // signed / unsigned mismatch
        !            23:        #pragma warning (disable:4102)          // ignore unused label warning
        !            24:        #pragma warning (disable:4049)          // (this one is silly, its not important) compiler limit, end of line numbering
        !            25:        #pragma warning (disable:4800)          // Performance Warning on Conversion of bool to int
        !            26:        #pragma warning (disable:4805)          // warning C4805: '|=' : unsafe mix of type 'int' and type 'bool' in operation
        !            27: #endif
        !            28: 
        !            29:  /*
        !            30:   * KVK - Fix for compliation using Visual Studio 6
        !            31:   *
        !            32:   * Microsoft have created multiple versions of the standard C calls, a specific version exists for each type of string encoding 
        !            33:   * format (in this case UNICODE (Wide) and ANSI (Ascii) versions. This has lead to there being versions with a A or a W after
        !            34:   * the name to signify the encoding. There are other additional reasons why they have these different versions (something to 
        !            35:   * do with the change from BSTR to string class passing I think, anyone?). The upshot is, we need to add a _ to the beginning of
        !            36:   * some of the function names for HAtari to compile..
        !            37:   *
        !            38:   * 2009 Vaughan Kaufman
        !            39:   *
        !            40:   */
        !            41: 
        !            42: #if defined(_VCWIN_)
        !            43:        #define STATIC_INLINE   static __inline
        !            44:        #define GLOB_ONLYDIR 0
        !            45:        
        !            46:        #include <io.h>
        !            47:        #include <direct.h>
        !            48:        #include <stdbool.h>
        !            49:        #include <tchar.h>
        !            50: 
        !            51:        #include <dirent.h>
        !            52: 
        !            53:        #define stat    _stat
        !            54:        #define S_IRUSR                 _S_IREAD
        !            55:        #define S_IWUSR                 _S_IWRITE
        !            56:        #define S_ISDIR(val)    (_S_IFDIR & val)
        !            57:        #define S_IFDIR                 _S_IFDIR
        !            58: 
        !            59:        #define strncasecmp     _strnicmp
        !            60:        #ifndef strcasecmp
        !            61:        #define strcasecmp      _stricmp
        !            62:        #endif
        !            63:        #define chdrive         _chdrive
        !            64:        #define strdup          _strdup
        !            65:        #define getcwd          _getcwd
        !            66:        #define fileno          _fileno
        !            67:        #define unlink          _unlink
        !            68:        #define access          _access
        !            69:        #ifndef mkdir
        !            70:        #define mkdir(name,mode) _mkdir(name)
        !            71:        #endif
        !            72:        #define rmdir           _rmdir
        !            73:        #define chmod           _chmod
        !            74:        #define itoa            _itoa
        !            75:        #define stricmp         _stricmp
        !            76:        #define snprintf        _snprintf
        !            77:        #define vsnprintf       _vsnprintf
        !            78: 
        !            79:        #define __attribute__(x)        /* x */
        !            80: 
        !            81:         // For new UI
        !            82: 
        !            83:        typedef unsigned short  mode_t;
        !            84: 
        !            85:        #ifndef _NEW_UI_TYPES
        !            86:        #define _NEW_UI_TYPES
        !            87:                typedef signed __int8           int8;
        !            88:                typedef unsigned __int8         uint8;
        !            89:                typedef signed __int16          int16;
        !            90:                typedef unsigned __int16        uint16;
        !            91:                typedef signed __int32          int32;
        !            92:                typedef unsigned __int32        uint32;
        !            93:                typedef signed __int64          int64;
        !            94:                typedef unsigned __int64        uint64;
        !            95:                typedef void*                           memptr;
        !            96:        #endif
        !            97: 
        !            98:        typedef signed __int8           int8_t;
        !            99:        typedef unsigned __int8         uint8_t;
        !           100:        typedef signed __int16          int16_t;
        !           101:        typedef unsigned __int16        uint16_t;
        !           102:        typedef signed __int32          int32_t;
        !           103:        typedef unsigned __int32        uint32_t;
        !           104:        typedef signed __int64          int64_t;
        !           105:        typedef unsigned __int64        uint64_t;
        !           106: 
        !           107:        #ifndef __inline__      
        !           108:        #define __inline__      __inline
        !           109:        #endif
        !           110: 
        !           111:                /* The variable-types used in the CPU core: */
        !           112:        typedef uint8_t uae_u8;
        !           113:        typedef int8_t uae_s8;
        !           114: 
        !           115:        typedef uint16_t uae_u16;
        !           116:        typedef int16_t uae_s16;
        !           117: 
        !           118:        typedef uint32_t uae_u32;
        !           119:        typedef int32_t uae_s32;
        !           120: 
        !           121:        typedef uae_u32 uaecptr;
        !           122: 
        !           123:        extern  void LOG_TRACE(int level, ...);
        !           124:        extern  void LOG_TRACE_PRINT(char* strFirstString, ...);
        !           125: 
        !           126:        #ifdef JOY_BUTTON1
        !           127:        #undef JOY_BUTTON1
        !           128:        #endif
        !           129:        #ifdef JOY_BUTTON2
        !           130:        #undef JOY_BUTTON2
        !           131:        #endif
        !           132: 
        !           133:        extern  void Win_OpenCon(void);
        !           134: 
        !           135: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.