• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision3aa4d145ab3a3100f5c18890e398a38725c23fa7 (tree)
Zeit2020-03-22 14:47:31
AutorHourier <hourier@user...>
CommiterHourier

Log Message

[Refactor] #40274 WIN32のプリプロが有効であることを前提とし、main-win.c からプリプロ自体を削除 / Removed WIN32 but existing codes are as-is in main-win.c

Ändern Zusammenfassung

Diff

--- a/src/main-win.c
+++ b/src/main-win.c
@@ -123,15 +123,6 @@
123123 #include "dungeon.h"
124124
125125 /*
126- * Extract the "WIN32" flag from the compiler
127- */
128-#if defined(__WIN32__) || defined(__WINNT__) || defined(__NT__)
129-# ifndef WIN32
130-# define WIN32
131-# endif
132-#endif
133-
134-/*
135126 * Available graphic modes
136127 */
137128 #define GRAPHICS_NONE 0
@@ -294,6 +285,8 @@
294285 #define MMNOMMIO /* Multimedia file I/O support */
295286 #define MMNOMMSYSTEM /* General MMSYSTEM functions */
296287
288+#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
289+
297290 /*
298291 * Standard sound names
299292 */
@@ -409,23 +402,7 @@ const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
409402 */
410403 #include "readdib.h"
411404
412- /*
413- * Hack -- Fake declarations from "dos.h"
414- */
415-#ifdef WIN32
416-#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
417-#else /* WIN32 */
418-#define FA_LABEL 0x08 /* Volume label */
419-#define FA_DIREC 0x10 /* Directory */
420-unsigned _cdecl _dos_getfileattr(concptr, unsigned *);
421-#endif /* WIN32 */
422-
423-/*
424- * Silliness in WIN32 drawing routine
425- */
426-#ifdef WIN32
427-# define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL)
428-#endif /* WIN32 */
405+#define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL)
429406
430407 /*
431408 * Silliness for Windows 95
@@ -825,22 +802,11 @@ static void DrawBG(HDC hdc, RECT *r)
825802 static bool check_file(concptr s)
826803 {
827804 char path[1024];
828-
829-#ifdef WIN32
830-
831805 DWORD attrib;
832806
833-#else /* WIN32 */
834-
835- unsigned int attrib;
836-
837-#endif /* WIN32 */
838-
839807 /* Copy it */
840808 strcpy(path, s);
841809
842-#ifdef WIN32
843-
844810 /* Examine */
845811 attrib = GetFileAttributes(path);
846812
@@ -850,19 +816,6 @@ static bool check_file(concptr s)
850816 /* Prohibit directory */
851817 if (attrib & FILE_ATTRIBUTE_DIRECTORY) return FALSE;
852818
853-#else /* WIN32 */
854-
855- /* Examine and verify */
856- if (_dos_getfileattr(path, &attrib)) return FALSE;
857-
858- /* Prohibit something */
859- if (attrib & FA_LABEL) return FALSE;
860-
861- /* Prohibit directory */
862- if (attrib & FA_DIREC) return FALSE;
863-
864-#endif /* WIN32 */
865-
866819 /* Success */
867820 return TRUE;
868821 }
@@ -876,17 +829,8 @@ static bool check_dir(concptr s)
876829 int i;
877830
878831 char path[1024];
879-
880-#ifdef WIN32
881-
882832 DWORD attrib;
883833
884-#else /* WIN32 */
885-
886- unsigned int attrib;
887-
888-#endif /* WIN32 */
889-
890834 /* Copy it */
891835 strcpy(path, s);
892836
@@ -896,8 +840,6 @@ static bool check_dir(concptr s)
896840 /* Remove trailing backslash */
897841 if (i && (path[i - 1] == '\\')) path[--i] = '\0';
898842
899-#ifdef WIN32
900-
901843 /* Examine */
902844 attrib = GetFileAttributes(path);
903845
@@ -907,19 +849,6 @@ static bool check_dir(concptr s)
907849 /* Require directory */
908850 if (!(attrib & FILE_ATTRIBUTE_DIRECTORY)) return FALSE;
909851
910-#else /* WIN32 */
911-
912- /* Examine and verify */
913- if (_dos_getfileattr(path, &attrib)) return FALSE;
914-
915- /* Prohibit something */
916- if (attrib & FA_LABEL) return FALSE;
917-
918- /* Require directory */
919- if (!(attrib & FA_DIREC)) return FALSE;
920-
921-#endif /* WIN32 */
922-
923852 /* Success */
924853 return TRUE;
925854 }
@@ -2152,17 +2081,8 @@ static errr term_xtra_win_sound(int v)
21522081 /* Build the path */
21532082 path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_external(i)]);
21542083
2155-#ifdef WIN32
2156-
21572084 /* Play the sound, catch errors */
21582085 return (PlaySound(buf, 0, SND_FILENAME | SND_ASYNC));
2159-
2160-#else /* WIN32 */
2161-
2162- /* Play the sound, catch errors */
2163- return (sndPlaySound(buf, SND_ASYNC));
2164-
2165-#endif /* WIN32 */
21662086 }
21672087
21682088 /*
@@ -2230,8 +2150,6 @@ static errr term_xtra_win_music(int n, int v)
22302150 current_music_type = n;
22312151 current_music_id = v;
22322152
2233-#ifdef WIN32
2234-
22352153 mop.lpstrDeviceType = mci_device_type;
22362154 mop.lpstrElementName = buf;
22372155 mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0);
@@ -2240,8 +2158,6 @@ static errr term_xtra_win_music(int n, int v)
22402158 mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
22412159 mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
22422160 return 0;
2243-
2244-#endif /* WIN32 */
22452161 }
22462162
22472163
@@ -2250,33 +2166,9 @@ static errr term_xtra_win_music(int n, int v)
22502166 */
22512167 static int term_xtra_win_delay(int v)
22522168 {
2253-
2254-#ifdef WIN32
2255-
22562169 /* Sleep */
22572170 Sleep(v);
22582171
2259-#else /* WIN32 */
2260-
2261- DWORD t;
2262- MSG msg;
2263-
2264- /* Final count */
2265- t = GetTickCount() + v;
2266-
2267- /* Wait for it */
2268- while (GetTickCount() < t)
2269- {
2270- /* Handle messages */
2271- if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
2272- {
2273- TranslateMessage(&msg);
2274- DispatchMessage(&msg);
2275- }
2276- }
2277-
2278-#endif /* WIN32 */
2279-
22802172 /* Success */
22812173 return 0;
22822174 }
--- a/src/readdib.c
+++ b/src/readdib.c
@@ -25,15 +25,6 @@
2525 #include "readdib.h"
2626
2727 /*
28- * Extract the "WIN32" flag from the compiler
29- */
30-#if defined(__WIN32__) || defined(__WINNT__) || defined(__NT__)
31-# ifndef WIN32
32-# define WIN32
33-# endif
34-#endif
35-
36-/*
3728 * Needed for lcc-win32
3829 */
3930 #ifndef SEEK_SET
Show on old repository browser