Annotation of hatari/src/cpu/compat.h, revision 1.1.1.6

1.1       root        1: /*
                      2:   Hatari - compat.h
                      3: 
1.1.1.2   root        4:   This file is distributed under the GNU General Public License, version 2
                      5:   or at your option any later version. Read the file gpl.txt for details.
1.1       root        6: 
1.1.1.2   root        7:   This file contains all the includes and defines specific to windows (such as
                      8:   TCHAR) needed by WinUAE CPU core.
                      9:   The aim is to have minimum changes in WinUae CPU core for next updates.
1.1       root       10: */
                     11: 
                     12: #ifndef HATARI_COMPAT_H
                     13: #define HATARI_COMPAT_H
                     14: 
1.1.1.6 ! root       15: #include <ctype.h>
1.1.1.5   root       16: #include "uae/string.h"
1.1       root       17: 
1.1.1.4   root       18: #define strnicmp strncasecmp
1.1       root       19: 
1.1.1.4   root       20: #define console_out printf
                     21: //#define console_out_f printf
                     22: #define console_out_f(...)     { if ( console_out_FILE ) fprintf ( console_out_FILE , __VA_ARGS__ ); else printf ( __VA_ARGS__ ); }
                     23: #define gui_message console_out_f
1.1       root       24: 
1.1.1.5   root       25: #define uae_log printf
                     26: 
1.1.1.6 ! root       27: 
        !            28: static inline void to_upper (TCHAR *s, int len) {
        !            29:        int i;
        !            30:        for (i = 0; i < len; i++) {
        !            31:                s[i] = toupper(s[i]);
        !            32:        }
        !            33: }
        !            34: 
        !            35: 
        !            36: static inline void my_trim (TCHAR *s)
        !            37: {
        !            38:        int len;
        !            39:        while (_tcslen (s) > 0 && _tcscspn (s, _T("\t \r\n")) == 0)
        !            40:                memmove (s, s + 1, (_tcslen (s + 1) + 1) * sizeof (TCHAR));
        !            41:        len = _tcslen (s);
        !            42:        while (len > 0 && _tcscspn (s + len - 1, _T("\t \r\n")) == 0)
        !            43:                s[--len] = '\0';
        !            44: }
        !            45: 
        !            46: 
1.1       root       47: #endif
1.1.1.5   root       48: 

unix.superglobalmegacorp.com

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