Skip to content

Commit

Permalink
revert all _WIN32s to WINDOWS (apart from in global.h where _WIN32 an…
Browse files Browse the repository at this point in the history
…d _WIN64 are used to set WINDOWS automatically)
  • Loading branch information
ttlanhil committed Apr 15, 2006
1 parent 3e29302 commit a7c28bb
Show file tree
Hide file tree
Showing 27 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion actor_scripts.c
Expand Up @@ -2095,7 +2095,7 @@ void init_actor_defs () {
// initialize the whole thing to zero
memset (actors_defs, 0, sizeof (actors_defs));

#ifndef _WIN32
#ifndef WINDOWS
snprintf (defdir, sizeof (defdir), "%s/%s", datadir, dirname);
#else
my_strcp (defdir, dirname);
Expand Down
2 changes: 1 addition & 1 deletion asc.c
Expand Up @@ -416,7 +416,7 @@ void get_string_digest(const Uint8 * string, Uint8 digest[16])
}
*/

#if defined(_WIN32) && (defined(__MINGW32__) || defined(_MSC_VER))
#if defined(WINDOWS) && (defined(__MINGW32__) || defined(_MSC_VER))
// the moronic _snprintf in MSVC doesn't necessarily terminate the string with
// a NULL byte. This function should at least terminate the string, but does
// not return the number of bytes that would have been written if the buffer
Expand Down
2 changes: 1 addition & 1 deletion asc.h
Expand Up @@ -213,7 +213,7 @@ int xmlGetInt(xmlNode *n, xmlChar *p);
*/
int my_xmlStrncopy(char ** dest, const char * src, int len);

#ifdef _WIN32
#ifdef WINDOWS
#if defined(_MSC_VER) || defined(__MINGW32__)
/*!
* \ingroup misc_utils
Expand Down
8 changes: 4 additions & 4 deletions books.c
Expand Up @@ -442,18 +442,18 @@ book * read_book(char * file, int type, int id)
book *b=NULL;
char path[1024];

#ifndef _WIN32
#ifndef WINDOWS
snprintf(path, sizeof(path), "%s/languages/%s/%s", datadir, lang, file);
#else
snprintf(path, sizeof(path), "languages/%s/%s", lang, file);
#endif // !_WIN32
#endif // !WINDOWS

if ((doc = xmlReadFile(path, NULL, 0)) == NULL) {
#ifndef _WIN32
#ifndef WINDOWS
snprintf(path, sizeof(path), "%s/%s", datadir, file);
#else
snprintf(path, sizeof(path), "%s", file);
#endif // !_WIN32
#endif // !WINDOWS
if((doc = xmlReadFile(path, NULL, 0)) == NULL) {
char str[200];

Expand Down
2 changes: 1 addition & 1 deletion cal3d_wrapper.h
Expand Up @@ -19,7 +19,7 @@
// Defines for Win32 and MingW32 //
//****************************************************************************//

#ifdef _WIN32
#ifdef WINDOWS

#ifdef __MINGW32__

Expand Down
4 changes: 2 additions & 2 deletions chat.c
Expand Up @@ -1049,15 +1049,15 @@ void init_channel_names ()

// Load the file, depending on WINDOWS = def|undef
// Then parse it. If that fails, fallback onto the english one. If that fails, use builtins.
#ifdef _WIN32
#ifdef WINDOWS
snprintf (file, sizeof (file), "%slanguages/%s/strings/channels.xml", configdir, lang);
#else
// try the data directory then
snprintf (file, sizeof (file), "%s/languages/%s/strings/channels.xml", datadir, lang);
#endif
doc = xmlParseFile (file);
if (doc == NULL ) {
#ifdef _WIN32
#ifdef WINDOWS
snprintf (file, sizeof (file), "%slanguages/en/strings/channels.xml", configdir);
#else
snprintf (file, sizeof (file), "%s/languages/en/strings/channels.xml", datadir);
Expand Down
6 changes: 3 additions & 3 deletions elconfig.c
Expand Up @@ -1282,7 +1282,7 @@ void init_vars()
add_var(BOOL,"show_grid","sgrid",&view_grid, change_var, 0, "Show grid", "Show grid",HUD);
#endif

#if !defined(_WIN32) && !defined(OSX)
#if !defined(WINDOWS) && !defined(OSX)
add_var(BOOL,"use_clipboard","uclb",&use_clipboard, change_var, 1, "Use clipboard for pasting", "Use CLIPBOARD for pasting (as e.g. GNOME does) or use PRIMARY cutbuffer (as xterm does)",MISC);
#endif
}
Expand Down Expand Up @@ -1326,7 +1326,7 @@ void write_var (FILE *fout, int ivar)

FILE* open_el_ini (const char *mode)
{
#ifdef _WIN32
#ifdef WINDOWS
return my_fopen ("el.ini", mode);
#else
char el_ini[256];
Expand Down Expand Up @@ -1393,7 +1393,7 @@ FILE* open_el_ini (const char *mode)
}

return f;
#endif //_WIN32
#endif //WINDOWS
}

int read_el_ini ()
Expand Down
4 changes: 2 additions & 2 deletions events.c
Expand Up @@ -5,7 +5,7 @@
#include "keys.h"
#include "update.h"

#ifndef _WIN32
#ifndef WINDOWS
#include <SDL_syswm.h>
#endif

Expand Down Expand Up @@ -69,7 +69,7 @@ int HandleEvent (SDL_Event *event)
switch( event->type )
{

#if !defined(_WIN32) && !defined(OSX)
#if !defined(WINDOWS) && !defined(OSX)
case SDL_SYSWMEVENT:

if(event->syswm.msg->event.xevent.type == SelectionNotify)
Expand Down
8 changes: 4 additions & 4 deletions gamewin.c
Expand Up @@ -826,7 +826,7 @@ int check_quit_or_fullscreen (Uint32 key)
{
int alt_on = key & ELW_ALT;
Uint16 keysym = key & 0xffff;
#ifndef _WIN32
#ifndef WINDOWS
int ctrl_on = key & ELW_CTRL;

// first, try to see if we pressed Alt+x or Ctrl+q, to quit.
Expand Down Expand Up @@ -913,7 +913,7 @@ int keypress_root_common (Uint32 key, Uint32 unikey)
}
else if ( (keysym == SDLK_v && ctrl_on) || (keysym == SDLK_INSERT && shift_on) )
{
#ifndef _WIN32
#ifndef WINDOWS
startpaste ();
#else
windows_paste ();
Expand Down Expand Up @@ -1251,7 +1251,7 @@ int keypress_root_common (Uint32 key, Uint32 unikey)
#else
// browser name can override the windows default, and if not defined in Linux, don't error
if(*browser_name){
#ifndef _WIN32
#ifndef WINDOWS
char browser_command[400];
snprintf (browser_command, sizeof (browser_command), "%s \"%s\"&", browser_name, current_url);
system (browser_command);
Expand All @@ -1261,7 +1261,7 @@ int keypress_root_common (Uint32 key, Uint32 unikey)
go_to_url_thread = SDL_CreateThread (go_to_url, 0);
} else {
ShellExecute(NULL, "open", current_url, NULL, NULL, SW_SHOWNORMAL); //this returns an int we could check for errors, but that's mainly when you use shellexecute for local files
#endif //_WIN32
#endif //WINDOWS
}
#endif // OSX
}
Expand Down
4 changes: 2 additions & 2 deletions gl_init.c
Expand Up @@ -309,7 +309,7 @@ void setup_video_mode(int fs, int mode)
//1400x1050
bpp=0;//autodetect
}
#ifndef _WIN32
#ifndef WINDOWS
bpp=0;//under X, we can't change the desktop BPP
#endif
}
Expand Down Expand Up @@ -444,7 +444,7 @@ void init_video()
have_stencil=0;

}
#ifdef _WIN32
#ifdef WINDOWS
//try to see if we get hardware acceleration, or the windows generic shit
{
int len;
Expand Down
12 changes: 6 additions & 6 deletions global.h
Expand Up @@ -11,12 +11,12 @@
#define M_PI 3.14159265358979323846
#endif //M_PI

// we do NOT want to have all our code checking for _WIN32, or _WIN64 will be broken, check for WINDOWS
//only ever use WINDOWS anywhere else, in case we need to add another 'catch' to enable WINDOWS
#if defined(_WIN32) || defined(_WIN64)
#ifndef WINDOWS
#define WINDOWS 1
#endif //WINDOWS
#endif //_WIN32
#ifndef WINDOWS
#define WINDOWS
#endif //!WINDOWS
#endif //_WIN32 || _WIN64
#ifdef OSX86 //Most i386 = PPC, but not all
#define OSX
#endif
Expand Down Expand Up @@ -49,7 +49,7 @@
#else
#include <AL/al.h>
#include <AL/alut.h>
#endif //_WIN32
#endif //WINDOWS

#ifdef EL_BIG_ENDIAN
#define SwapLEFloat(X) SwapFloat(X)
Expand Down
4 changes: 2 additions & 2 deletions init.c
Expand Up @@ -171,7 +171,7 @@ void load_knowledge_list()

void read_config()
{
#ifndef _WIN32
#ifndef WINDOWS
DIR *d = NULL;
struct stat statbuff;
mode_t modes;
Expand Down Expand Up @@ -203,7 +203,7 @@ void read_config()
exit (1);
}

#ifndef _WIN32
#ifndef WINDOWS
chdir(datadir);
#endif

Expand Down
2 changes: 1 addition & 1 deletion init.h
Expand Up @@ -155,7 +155,7 @@ extern int buddy_log_notice; /*!< whether to log buddy logged on/off notices to
extern char configdir[256]; /*!< the default directory where we look for configuration files */
extern char datadir[256]; /*!< the default directory where we look for data files (aka installation dir) */
extern int show_help_text;
#if !defined(_WIN32) && !defined(OSX)
#if !defined(WINDOWS) && !defined(OSX)
extern int use_clipboard; /*!< whether to use CLIPBOARD or PRIMARY for pasting */
#endif

Expand Down
6 changes: 3 additions & 3 deletions interface.c
Expand Up @@ -271,7 +271,7 @@ void build_video_mode_array()
else
flags=SDL_OPENGL;

#ifdef _WIN32
#ifdef WINDOWS
if(bpp==16 || full_screen){
#else
if(bpp==16){
Expand All @@ -286,7 +286,7 @@ void build_video_mode_array()
if(SDL_VideoModeOK(1440, 900, 16, flags))video_modes[14].supported=1;
if(SDL_VideoModeOK(1680, 1050, 16, flags))video_modes[16].supported=1;
}
#ifdef _WIN32
#ifdef WINDOWS
if(bpp==32 || full_screen){
#else
if(bpp==32){
Expand Down Expand Up @@ -949,7 +949,7 @@ void save_markings()
char marks_file[256];
int i;

#ifndef _WIN32
#ifndef WINDOWS
snprintf (marks_file, sizeof(marks_file), "%s/.elc/%s.txt", getenv ("HOME"), strrchr (map_file_name,'/') + 1);
#else
snprintf (marks_file, sizeof (marks_file), "%s.txt", strrchr (map_file_name,'/') + 1);
Expand Down
2 changes: 1 addition & 1 deletion keys.c
Expand Up @@ -77,7 +77,7 @@ void read_key_config()
struct stat key_file;
int key_file_size,t;

#ifndef _WIN32
#ifndef WINDOWS
char key_ini[256];
snprintf (key_ini, sizeof (key_ini), "%s/key.ini", configdir);
// don't use my_fopen, not everyone keeps local settings
Expand Down
2 changes: 1 addition & 1 deletion kills.c
Expand Up @@ -162,7 +162,7 @@ void log_kill(char *actor_name, int is_player)
snprintf(filename, sizeof(filename), "%s/kills_%s.dat", configdir, username);

if (!(f = my_fopen(filename, "r+b")) && !(f = my_fopen(filename, "w+b"))) {
#ifdef _WIN32
#ifdef WINDOWS
snprintf(filename, sizeof(filename), "kills_%s.dat", username);
if (!(f = my_fopen(filename, "r+b")) && !(f = my_fopen(filename, "w+b"))) {
return;
Expand Down
7 changes: 4 additions & 3 deletions main.c
Expand Up @@ -2,22 +2,23 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "global.h"
#ifdef NETWORK_THREAD
#include "queue.h"
#endif //NETWORK_THREAD

#ifdef __GNUC__
#include <unistd.h>
#ifdef _WIN32
#ifdef WINDOWS
#include <process.h>
#endif
#endif

#if defined(_WIN32) || defined(_WIN64)
#ifdef WINDOWS
#include <windows.h>
#undef WRITE_XML
char *win_command_line;
#endif
#endif //WINDOWS

#include "global.h"
#include "init.h"
Expand Down
2 changes: 1 addition & 1 deletion map_io.c
Expand Up @@ -550,7 +550,7 @@ void load_map_marks()
//Oops
return;
}
#ifndef _WIN32
#ifndef WINDOWS
snprintf (marks_file, sizeof (marks_file), "%s%s.txt", configdir, mapname + 1);
#else
snprintf (marks_file, sizeof (marks_file), "%s.txt", mapname + 1);
Expand Down
8 changes: 4 additions & 4 deletions misc.c
Expand Up @@ -341,7 +341,7 @@ void find_last_url(const unsigned char *source_string, const int len)
have_url = 1;
}

#ifdef _WIN32
#ifdef WINDOWS
int go_to_url(void *dummy)
{
char browser_command[400];
Expand Down Expand Up @@ -553,11 +553,11 @@ void makeScreenShot ()
ret = file_exists(fname);
if(ret == 0)
{
#ifndef _WIN32
#ifndef WINDOWS
if (mkdir(fname, 0755) < 0)
#else //_WIN32
#else //WINDOWS
if (mkdir(fname) < 0)
#endif //!_WIN32
#endif //!WINDOWS
{
LOG_ERROR ("Unable to create directory \"%s\"\n", fname);
return;
Expand Down
4 changes: 2 additions & 2 deletions notepad.c
Expand Up @@ -193,7 +193,7 @@ int notepadLoadFile ()
doc = xmlParseFile (file);
if (doc == NULL )
{
#ifndef _WIN32
#ifndef WINDOWS
// try the data directory then
snprintf (file, sizeof (file), "%s/%s", datadir, "notes.xml");
doc = xmlParseFile (file);
Expand Down Expand Up @@ -294,7 +294,7 @@ int notepadSaveFile (widget_list *w, int mx, int my, Uint32 flags)
}
if (xmlSaveFormatFileEnc (file, doc, "UTF-8", 1) < 0)
{
#ifndef _WIN32
#ifndef WINDOWS
// error writing. try the data directory
snprintf (file, sizeof (file), "%s/%s", datadir, "notes.xml");
if (xmlSaveFormatFileEnc(file, doc, "UTF-8", 1) < 0)
Expand Down
4 changes: 2 additions & 2 deletions particles.c
@@ -1,6 +1,6 @@
#include <stdlib.h>
#include <math.h>
#ifndef _WIN32
#ifndef WINDOWS
#include <locale.h>
#endif
#ifdef MAP_EDITOR2
Expand Down Expand Up @@ -129,7 +129,7 @@ particle_sys_def *load_particle_def(const char *filename)
fclose(f);
return NULL;
}
#ifndef _WIN32
#ifndef WINDOWS
setlocale(LC_NUMERIC,"en_US");
#endif
// System info
Expand Down
6 changes: 3 additions & 3 deletions paste.c
Expand Up @@ -2,7 +2,7 @@
#include <string.h>
#include "global.h"

#ifndef _WIN32
#ifndef WINDOWS
#include <SDL_syswm.h>
#endif

Expand All @@ -25,7 +25,7 @@ void finishpaste (void* event)
// Todo. This :-)
}
#else
#ifndef _WIN32
#ifndef WINDOWS

int use_clipboard = 1;

Expand Down Expand Up @@ -120,5 +120,5 @@ void windows_paste()
CloseClipboard();
}

#endif //ndef _WIN32
#endif //ndef WINDOWS
#endif //OSX

0 comments on commit a7c28bb

Please sign in to comment.