summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2018-02-09 14:39:42 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2018-02-09 14:39:42 +0000
commit52ae3582a2c7bb437df33c0a30bfd5a01d6c5282 (patch)
tree4f532a97ab0a6a1c2f96454290bc8803ee022f1f /test
parent30dad6a4aa2b94fe91783160c86abc75f9dc9e23 (diff)
Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32". Replace "WIN32" in text and documentation with "Windows". Replace "MSWindows" with "Windows". To do: README.Windows.txt (and maybe other documentation as well) needs updates. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/blocks.cxx28
-rw-r--r--test/color_chooser.cxx8
-rw-r--r--test/demo.cxx10
-rw-r--r--test/editor.cxx2
-rw-r--r--test/fractals.cxx2
-rw-r--r--test/fracviewer.cxx4
-rw-r--r--test/fullscreen.cxx2
-rw-r--r--test/image.cxx2
-rw-r--r--test/list_visuals.cxx2
-rw-r--r--test/native-filechooser.cxx2
-rw-r--r--test/sudoku.cxx26
-rw-r--r--test/table.cxx4
-rw-r--r--test/threads.cxx6
-rw-r--r--test/threads.h2
-rw-r--r--test/tiled_image.cxx4
-rw-r--r--test/utf8.cxx4
16 files changed, 54 insertions, 54 deletions
diff --git a/test/blocks.cxx b/test/blocks.cxx
index 691c54130..029133e5b 100644
--- a/test/blocks.cxx
+++ b/test/blocks.cxx
@@ -34,16 +34,16 @@
// Audio headers...
#include <config.h>
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: FLTK does not provide cross platform sound support"
#else
#endif
-#ifndef WIN32
+#ifndef _WIN32
# include <unistd.h>
# include <sys/time.h> // gettimeofday()
-#endif // !WIN32
+#endif // !_WIN32
#ifdef HAVE_ALSA_ASOUNDLIB_H
# define ALSA_PCM_NEW_HW_PARAMS_API
@@ -52,9 +52,9 @@
#ifdef __APPLE__
# include <CoreAudio/AudioHardware.h>
#endif // __APPLE__
-#ifdef WIN32
+#ifdef _WIN32
# include <mmsystem.h>
-#endif // WIN32
+#endif // _WIN32
#define BLOCK_COLS 20
#define BLOCK_ROWS 10
@@ -175,7 +175,7 @@ class BlockSound {
AudioBufferList *data_out,
const AudioTimeStamp *time_out,
void *client_data);
-#elif defined(WIN32)
+#elif defined(_WIN32)
HWAVEOUT device;
HGLOBAL header_handle;
LPWAVEHDR header_ptr;
@@ -243,7 +243,7 @@ BlockSound::BlockSound() {
sample_size = (int)format.mSampleRate;
-#elif defined(WIN32)
+#elif defined(_WIN32)
WAVEFORMATEX format;
memset(&format, 0, sizeof(format));
@@ -340,7 +340,7 @@ BlockSound::~BlockSound() {
# endif
}
-#elif defined(WIN32)
+#elif defined(_WIN32)
if (sample_size) {
waveOutClose(device);
@@ -405,20 +405,20 @@ void BlockSound::play_explosion(float duration) {
if (duration <= 0.0)
return;
-#if defined(__APPLE__) || defined(WIN32) || defined(HAVE_ALSA_ASOUNDLIB_H)
+#if defined(__APPLE__) || defined(_WIN32) || defined(HAVE_ALSA_ASOUNDLIB_H)
if (duration > 1.0)
duration = 1.0;
int samples = (int)(duration * sample_size);
short *sample_ptr = sample_data + 2 * (sample_size - samples);
-#endif // __APPLE__ || WIN32 || HAVE_ALSA_ASOUNDLIB_H
+#endif // __APPLE__ || _WIN32 || HAVE_ALSA_ASOUNDLIB_H
#ifdef __APPLE__
// Point to the next note...
data = sample_ptr;
remaining = samples * 2;
-#elif defined(WIN32)
+#elif defined(_WIN32)
if (sample_size) {
memcpy(data_ptr, sample_ptr, samples * 4);
@@ -899,19 +899,19 @@ void BlockWindow::timeout_cb(BlockWindow *bw) {
static int ntime = 0;
static int level = 0;
-#if !defined(WIN32)
+#if !defined(_WIN32)
{
struct timeval atime;
gettimeofday(&atime, NULL);
curtime = atime.tv_sec % 60 + 0.000001 * atime.tv_usec;
}
-#else // (WIN32)
+#else // (_WIN32)
{
SYSTEMTIME atime;
GetLocalTime(&atime);
curtime = atime.wSecond + 0.001 * atime.wMilliseconds;
}
-#endif // (WIN32)
+#endif // (_WIN32)
// platform independent part of timer debugging code
if (bw->interval_ > 0) { // game is active
diff --git a/test/color_chooser.cxx b/test/color_chooser.cxx
index 887962961..cc60a363b 100644
--- a/test/color_chooser.cxx
+++ b/test/color_chooser.cxx
@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
-#if !defined(WIN32) && !defined(__APPLE__) && !defined(FL_PORTING)
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(FL_PORTING)
#include "list_visuals.cxx"
#endif
@@ -114,7 +114,7 @@ int main(int argc, char ** argv) {
" - : default visual\n"
" r : call Fl::visual(FL_RGB)\n"
" c : call Fl::own_colormap()\n",argv[0]);
-#if !defined(WIN32) && !defined(__APPLE__) && !defined(FL_PORTING)
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(FL_PORTING)
printf(" # : use this visual with an empty colormap:\n");
list_visuals();
#endif
@@ -127,7 +127,7 @@ int main(int argc, char ** argv) {
} else if (argv[i][0] == 'c') {
Fl::own_colormap();
} else if (argv[i][0] != '-') {
-#if !defined(WIN32) && !defined(__APPLE__) && !defined(FL_PORTING)
+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(FL_PORTING)
int visid = atoi(argv[i]);
fl_open_display();
XVisualInfo templt; int num;
@@ -138,7 +138,7 @@ int main(int argc, char ** argv) {
fl_visual->visual, AllocNone);
fl_xpixel(FL_BLACK); // make sure black is allocated
#else
- Fl::fatal("Visual id's not supported on MSWindows or MacOS.");
+ Fl::fatal("Visual id's not supported on Windows or MacOS.");
#endif
}
}
diff --git a/test/demo.cxx b/test/demo.cxx
index 44646af92..e6497aa73 100644
--- a/test/demo.cxx
+++ b/test/demo.cxx
@@ -62,7 +62,7 @@
// #if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG
-#if defined(WIN32) && defined(__MWERKS__) && defined(_DEBUG)
+#if defined(_WIN32) && defined(__MWERKS__) && defined(_DEBUG)
# define DEBUG_EXE_WITH_D 1
#else
# define DEBUG_EXE_WITH_D 0
@@ -241,7 +241,7 @@ void dobut(Fl_Widget *, long arg) {
push_menu(menus[men].icommand[bn]);
} else {
-#ifdef WIN32
+#ifdef _WIN32
STARTUPINFO suInfo; // Process startup information
PROCESS_INFORMATION prInfo; // Process information
@@ -260,7 +260,7 @@ void dobut(Fl_Widget *, long arg) {
char* copy_of_icommand = new char[icommand_length+1];
strcpy(copy_of_icommand,menus[men].icommand[bn]);
- // On WIN32 the .exe suffix needs to be appended to the command
+ // On Windows the .exe suffix needs to be appended to the command
// whilst leaving any additional parameters unchanged - this
// is required to handle the correct conversion of cases such as :
// `../fluid/fluid valuators.fl' to '../fluid/fluid.exe valuators.fl'.
@@ -346,7 +346,7 @@ void dobut(Fl_Widget *, long arg) {
system(command);
free(cmd);
-#else // NON WIN32 systems.
+#else // Non Windows systems.
int icommand_length = strlen(menus[men].icommand[bn]);
char* command = new char[icommand_length+5]; // 5 for extra './' and ' &\0'
@@ -356,7 +356,7 @@ void dobut(Fl_Widget *, long arg) {
delete[] command;
-#endif // WIN32
+#endif // _WIN32
}
}
diff --git a/test/editor.cxx b/test/editor.cxx
index 868d14c30..0978d36bd 100644
--- a/test/editor.cxx
+++ b/test/editor.cxx
@@ -676,7 +676,7 @@ void set_title(Fl_Window* w) {
else {
char *slash;
slash = strrchr(filename, '/');
-#ifdef WIN32
+#ifdef _WIN32
if (slash == NULL) slash = strrchr(filename, '\\');
#endif
if (slash != NULL) strcpy(title, slash + 1);
diff --git a/test/fractals.cxx b/test/fractals.cxx
index 1b20e25f9..435ede1b6 100644
--- a/test/fractals.cxx
+++ b/test/fractals.cxx
@@ -67,7 +67,7 @@ int main(int, char**) {
#include "fracviewer.h"
-#if defined(WIN32)
+#if defined(_WIN32)
# define drand48() (((float) rand())/((float) RAND_MAX))
# define srand48(x) (srand((x)))
#elif defined __APPLE__
diff --git a/test/fracviewer.cxx b/test/fracviewer.cxx
index 605731d21..e1467619b 100644
--- a/test/fracviewer.cxx
+++ b/test/fracviewer.cxx
@@ -23,9 +23,9 @@
# include <math.h>
# include <sys/types.h>
# include <time.h>
-# if !defined(WIN32)
+# if !defined(_WIN32)
# include <sys/time.h>
-# endif // !WIN32
+# endif // !_WIN32
# include "fracviewer.h"
diff --git a/test/fullscreen.cxx b/test/fullscreen.cxx
index 27fa4ed30..b16e1e992 100644
--- a/test/fullscreen.cxx
+++ b/test/fullscreen.cxx
@@ -171,7 +171,7 @@ void fullscreen_cb(Fl_Widget *o, void *p) {
int d = ((Fl_Button *)o)->value();
if (d) {
w->fullscreen();
-#ifndef WIN32 // update our border state in case border was turned off
+#ifndef _WIN32 // update our border state in case border was turned off
border_button->value(w->border());
#endif
} else {
diff --git a/test/image.cxx b/test/image.cxx
index ff2f9ab1b..05369d639 100644
--- a/test/image.cxx
+++ b/test/image.cxx
@@ -73,7 +73,7 @@ void button_cb(Fl_Widget *,void *) {
}
#include <FL/platform.H>
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(__APPLE__)
#include "list_visuals.cxx"
#endif
diff --git a/test/list_visuals.cxx b/test/list_visuals.cxx
index dca7de222..a4516afcf 100644
--- a/test/list_visuals.cxx
+++ b/test/list_visuals.cxx
@@ -24,7 +24,7 @@
// http://www.fltk.org/str.php
//
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
#include <FL/Fl.H>
#include <FL/fl_message.H>
diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx
index 834ac3d44..6730ab65e 100644
--- a/test/native-filechooser.cxx
+++ b/test/native-filechooser.cxx
@@ -88,7 +88,7 @@ int main(int argc, char **argv) {
//// no icons will be shown. However, this means you do not need to link in the
//// fltk_images library, potentially reducing the size of your executable.
//// Loading the system icons is not required by the OSX or Windows native file choosers.
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(__APPLE__)
Fl_File_Icon::load_system_icons();
#endif
diff --git a/test/sudoku.cxx b/test/sudoku.cxx
index 218e81b35..14255daab 100644
--- a/test/sudoku.cxx
+++ b/test/sudoku.cxx
@@ -33,20 +33,20 @@
#include <time.h>
#include <FL/math.h>
-#ifdef WIN32
+#ifdef _WIN32
# include "sudokurc.h"
#elif !defined(__APPLE__)
# include "pixmaps/sudoku.xbm"
-#endif // WIN32
+#endif // _WIN32
// Audio headers...
#include <config.h>
-#ifndef WIN32
+#ifndef _WIN32
# include <unistd.h>
-#endif // !WIN32
+#endif // !_WIN32
-#if defined(WIN32) || defined(__APPLE__)
+#if defined(_WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: FLTK does not provide cross platform sound support"
#else
@@ -59,9 +59,9 @@
#ifdef __APPLE__
# include <CoreAudio/AudioHardware.h>
#endif // __APPLE__
-#ifdef WIN32
+#ifdef _WIN32
# include <mmsystem.h>
-#endif // WIN32
+#endif // _WIN32
//
@@ -113,7 +113,7 @@ class SudokuSound {
AudioBufferList *data_out,
const AudioTimeStamp *time_out,
void *client_data);
-#elif defined(WIN32)
+#elif defined(_WIN32)
HWAVEOUT device;
HGLOBAL header_handle;
LPWAVEHDR header_ptr;
@@ -259,7 +259,7 @@ SudokuSound::SudokuSound() {
sample_size = (int)format.mSampleRate / 20;
-#elif defined(WIN32)
+#elif defined(_WIN32)
WAVEFORMATEX format;
memset(&format, 0, sizeof(format));
@@ -364,7 +364,7 @@ SudokuSound::~SudokuSound() {
# endif
}
-#elif defined(WIN32)
+#elif defined(_WIN32)
if (sample_size) {
waveOutClose(device);
@@ -438,7 +438,7 @@ void SudokuSound::play(char note) {
// Wait for the sound to complete...
usleep(NOTE_DURATION*1000);
-#elif defined(WIN32)
+#elif defined(_WIN32)
if (sample_size) {
memcpy(data_ptr, sample_data[note - 'A'], sample_size * 4);
@@ -711,14 +711,14 @@ Sudoku::Sudoku()
}
// Set icon for window (MacOS uses app bundle for icon...)
-#ifdef WIN32
+#ifdef _WIN32
icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON)));
#elif !defined(__APPLE__)
fl_open_display();
icon((char *)XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display),
(char *)sudoku_bits, sudoku_width,
sudoku_height));
-#endif // WIN32
+#endif // _WIN32
// Catch window close events...
callback(close_cb);
diff --git a/test/table.cxx b/test/table.cxx
index 2890895f8..5c4ab3e69 100644
--- a/test/table.cxx
+++ b/test/table.cxx
@@ -4,9 +4,9 @@
#include <stdio.h>
#include <string.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <stdlib.h> // atoi
-#endif /*WIN32*/
+#endif /* _WIN32 */
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
diff --git a/test/threads.cxx b/test/threads.cxx
index 522aa0a9f..2fe40eb54 100644
--- a/test/threads.cxx
+++ b/test/threads.cxx
@@ -3,7 +3,7 @@
//
// Threading example program for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2018 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -18,7 +18,7 @@
#include <config.h>
-#if defined(HAVE_PTHREAD) || defined(WIN32)
+#if defined(HAVE_PTHREAD) || defined(_WIN32)
# include <FL/Fl.H>
# include <FL/Fl_Double_Window.H>
# include <FL/Fl_Browser.H>
@@ -156,7 +156,7 @@ int main(int argc, char **argv)
int main() {
fl_alert("Sorry, threading not supported on this platform!");
}
-#endif // HAVE_PTHREAD || WIN32
+#endif // HAVE_PTHREAD || _WIN32
//
diff --git a/test/threads.h b/test/threads.h
index d81f1e6a6..d90d6e422 100644
--- a/test/threads.h
+++ b/test/threads.h
@@ -48,7 +48,7 @@ static int fl_create_thread(Fl_Thread& t, Fl_Thread_Func* f, void* p) {
return pthread_create((pthread_t*)&t, 0, f, p);
}
-# elif defined(WIN32) && !defined(__WATCOMC__) // Use Windows threading...
+# elif defined(_WIN32) && !defined(__WATCOMC__) // Use Windows threading...
# include <windows.h>
# include <process.h>
diff --git a/test/tiled_image.cxx b/test/tiled_image.cxx
index 7d702c28f..f858583df 100644
--- a/test/tiled_image.cxx
+++ b/test/tiled_image.cxx
@@ -35,7 +35,7 @@ void button_cb(Fl_Widget *,void *) {
}
#include <FL/platform.H>
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(__APPLE__)
#include "list_visuals.cxx"
#endif
@@ -51,7 +51,7 @@ int arg(int argc, char **argv, int &i) {
}
int main(int argc, char **argv) {
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(__APPLE__)
int i = 1;
Fl::args(argc,argv,i,arg);
diff --git a/test/utf8.cxx b/test/utf8.cxx
index b2c40fcb9..5dd9f57df 100644
--- a/test/utf8.cxx
+++ b/test/utf8.cxx
@@ -419,7 +419,7 @@ int make_font_chooser(void)
// Load the systems available fonts - ask for everything
// font_count = Fl::set_fonts("*");
-#ifdef WIN32
+#ifdef _WIN32
font_count = Fl::set_fonts("*");
#elif defined(__APPLE__)
font_count = Fl::set_fonts("*");
@@ -580,7 +580,7 @@ int main(int argc, char** argv)
/* setup the extra font */
Fl::set_font(extra_font,
-#ifdef WIN32
+#ifdef _WIN32
" Arial Unicode MS"
#elif defined(__APPLE__)
"Monaco"