event->y < 0 ? MB_WHEEL_DOWN :
event->y > 0 ? MB_WHEEL_UP : 0);
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_MAC)
// accelerated mouse wheel available on Mac and Windows
wheel_steps = (event->x ? ABS(event->x) : ABS(event->y));
#else
// default random seed
seed = (int)time(NULL); // seconds since the epoch
-#if !defined(PLATFORM_WIN32)
+#if !defined(PLATFORM_WINDOWS)
// add some more randomness
struct timeval current_time;
{
static char *login_name = NULL;
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
if (login_name == NULL)
{
unsigned long buffer_size = MAX_USERNAME_LEN + 1;
{
static char *real_name = NULL;
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
if (real_name == NULL)
{
static char buffer[MAX_USERNAME_LEN + 1];
if (option_arg == next_option)
options_left++;
}
-#if defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_MAC)
else if (strPrefix(option, "-psn"))
{
// ignore process serial number when launched via GUI on Mac OS X
void clear_mem(void *ptr, unsigned int size)
{
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
// for unknown reason, memset() sometimes crashes when compiled with MinGW
char *cptr = (char *)ptr;
void NotifyUserAboutErrorFile(void)
{
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
char *title_text = getStringCat2(program.program_title, " Error Message");
char *error_text = getStringCat2("The program was aborted due to an error; "
"for details, see the following error file:"
// define main platform keywords
// ============================================================================
-#if defined(WIN32) || defined(_WIN32)
-#define PLATFORM_WIN32
+#if defined(WIN32) || defined(_WIN32) || defined(_WIN64)
+#define PLATFORM_WINDOWS
#define PLATFORM_STRING "Windows"
#else
#define PLATFORM_UNIX
#endif
#if defined(__APPLE__) && defined(__MACH__)
-#define PLATFORM_MACOSX
+#define PLATFORM_MAC
#undef PLATFORM_STRING
#define PLATFORM_STRING "Mac"
#endif
// (setting the window icon on Mac OS X would replace the high-quality
// dock icon with the currently smaller (and uglier) icon from file)
-#if !defined(PLATFORM_MACOSX)
+#if !defined(PLATFORM_MAC)
char *filename = getCustomImageFilename(basename);
SDL_Surface *surface;
#include <SDL_mixer.h>
#include <SDL_net.h>
#include <SDL_thread.h>
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
#include <SDL_syswm.h>
#endif
set the current working directory to the program package directory) */
char *main_data_path = getBasePath(command_filename);
-#if defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_MAC)
if (strSuffix(main_data_path, MAC_APP_BINARY_SUBDIR))
{
char *main_data_path_old = main_data_path;
// some stuff from "files.c"
// ============================================================================
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
#ifndef S_IRGRP
#define S_IRGRP S_IRUSR
#endif
#ifndef S_ISGID
#define S_ISGID 0
#endif
-#endif // PLATFORM_WIN32
+#endif // PLATFORM_WINDOWS
// file permissions for newly written files
#define MODE_R_ALL (S_IRUSR | S_IRGRP | S_IROTH)
{
static char *dir = NULL;
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
if (dir == NULL)
{
dir = checked_malloc(MAX_PATH + 1);
{
static char *personal_data_dir = NULL;
-#if defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_MAC)
if (personal_data_dir == NULL)
personal_data_dir = getPath2(getHomeDir(), "Documents");
#else
static int posix_mkdir(const char *pathname, mode_t mode)
{
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
return mkdir(pathname);
#else
return mkdir(pathname, mode);
Mix_VolumeMusic(mixer[audio.music_channel].volume);
Mix_FadeInMusic(mixer[audio.music_channel].data_ptr, loops, 100);
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
// playing MIDI music is broken since Windows Vista, as it sets the volume
// for MIDI music also for all other sounds and music, which cannot be set
// back to normal unless playing MIDI music again with that desired volume
Mix_FadeOutMusic(SOUND_FADING_INTERVAL);
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
// playing MIDI music is broken since Windows Vista, as it sets the volume
// for MIDI music also for all other sounds and music, which cannot be set
// back to normal unless playing MIDI music again with that desired volume
#define DEFAULT_AUDIO_SAMPLE_RATE AUDIO_SAMPLE_RATE_22050
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
#define DEFAULT_AUDIO_FRAGMENT_SIZE AUDIO_FRAGMENT_SIZE_1024
#else
#define DEFAULT_AUDIO_FRAGMENT_SIZE AUDIO_FRAGMENT_SIZE_512
#include "types.h"
-#if defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_MAC)
#include "macosx.h"
-#elif defined(PLATFORM_WIN32)
+#elif defined(PLATFORM_WINDOWS)
#include "windows.h"
#elif defined(PLATFORM_ANDROID)
#include "android.h"
#define DEFAULT_KEY_RIGHT KSYM_Right
#define DEFAULT_KEY_UP KSYM_Up
#define DEFAULT_KEY_DOWN KSYM_Down
-#if defined(PLATFORM_MACOSX)
+#if defined(PLATFORM_MAC)
#define DEFAULT_KEY_SNAP KSYM_Control_L
#define DEFAULT_KEY_DROP KSYM_KP_Enter
#else
#define STRING_NEWLINE_UNIX "\n"
#define STRING_NEWLINE_DOS "\r\n"
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
#define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_DOS
#define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_DOS
#define STRING_NEWLINE STRING_NEWLINE_DOS
#include <sys/types.h>
-#if !defined(PLATFORM_WIN32)
+#if !defined(PLATFORM_WINDOWS)
typedef int boolean;
typedef unsigned char byte;
#endif
strlen(setup.internal.program_icon_file) > 0)
program_icon_file = getStringCopy(setup.internal.program_icon_file);
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX) || defined(PLATFORM_EMSCRIPTEN)
+#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_MAC) || defined(PLATFORM_EMSCRIPTEN)
userdata_subdir = program_title;
#elif defined(PLATFORM_UNIX)
userdata_subdir = getStringCat2(".", userdata_basename);
// tests
// ============================================================================
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
/* FILETIME of Jan 1 1970 00:00:00. */
static const unsigned __int64 epoch = ((unsigned __int64) 116444736000000000ULL);
return seed_text;
}
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
static char *test_init_uuid_random_function_better_windows(void)
{
static char seed_text[100];
return (max > 0 ? prng_get_uint() % max : 0);
}
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
#define NUM_UUID_TESTS 3
#else
#define NUM_UUID_TESTS 2
test_uuid_random_function_better);
int xpos = 40;
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
if (nr == 2)
{
random_name = "windows";