]> git.saurik.com Git - wxWidgets.git/blame - include/wx/chkconf.h
wxSIZE_T_IS_UINT definition fix for mingw32 cross-compile
[wxWidgets.git] / include / wx / chkconf.h
CommitLineData
1e6feb95
VZ
1/*
2 * Name: wx/chkconf.h
3 * Purpose: check the config settings for consistency
4 * Author: Vadim Zeitlin
5 * Modified by:
6 * Created: 09.08.00
7 * RCS-ID: $Id$
8 * Copyright: (c) 2000 Vadim Zeitlin <vadim@wxwindows.org>
9 * Licence: wxWindows license
10 */
11
12/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
13
14/*
15 this global setting determintes what should we do if the setting FOO
16 requires BAR and BAR is not set: we can either silently define BAR
17 (default, recommended) or give an error and abort (mainly useful for
18 developpers only)
19 */
20#define wxABORT_ON_CONFIG_ERROR
21
22/*
23 all these tests are for GUI onlu
24 */
25#if wxUSE_GUI
26
27/*
28 all of the settings tested below must be defined or we'd get an error from
29 preprocessor about invalid integer expression
30 */
31
32#ifndef wxUSE_ACCEL
33# ifdef wxABORT_ON_CONFIG_ERROR
34# error "wxUSE_ACCEL must be defined."
35# else
36# define wxUSE_ACCEL 0
37# endif
38#endif /* !defined(wxUSE_ACCEL) */
39
40#ifndef wxUSE_BMPBUTTON
41# ifdef wxABORT_ON_CONFIG_ERROR
42# error "wxUSE_BMPBUTTON must be defined."
43# else
44# define wxUSE_BMPBUTTON 0
45# endif
46#endif /* !defined(wxUSE_BMPBUTTON) */
47
48#ifndef wxUSE_BUTTON
49# ifdef wxABORT_ON_CONFIG_ERROR
50# error "wxUSE_BUTTON must be defined."
51# else
52# define wxUSE_BUTTON 0
53# endif
54#endif /* !defined(wxUSE_BUTTON) */
55
56#ifndef wxUSE_CALENDARCTRL
57# ifdef wxABORT_ON_CONFIG_ERROR
58# error "wxUSE_CALENDARCTRL must be defined."
59# else
60# define wxUSE_CALENDARCTRL 0
61# endif
62#endif /* !defined(wxUSE_CALENDARCTRL) */
63
64#ifndef wxUSE_CARET
65# ifdef wxABORT_ON_CONFIG_ERROR
66# error "wxUSE_CARET must be defined."
67# else
68# define wxUSE_CARET 0
69# endif
70#endif /* !defined(wxUSE_CARET) */
71
72#ifndef wxUSE_CHECKBOX
73# ifdef wxABORT_ON_CONFIG_ERROR
74# error "wxUSE_CHECKBOX must be defined."
75# else
76# define wxUSE_CHECKBOX 0
77# endif
78#endif /* !defined(wxUSE_CHECKBOX) */
79
80#ifndef wxUSE_CHECKLISTBOX
81# ifdef wxABORT_ON_CONFIG_ERROR
82# error "wxUSE_CHECKLISTBOX must be defined."
83# else
84# define wxUSE_CHECKLISTBOX 0
85# endif
86#endif /* !defined(wxUSE_CHECKLISTBOX) */
87
88#ifndef wxUSE_CHOICE
89# ifdef wxABORT_ON_CONFIG_ERROR
90# error "wxUSE_CHOICE must be defined."
91# else
92# define wxUSE_CHOICE 0
93# endif
94#endif /* !defined(wxUSE_CHOICE) */
95
96#ifndef wxUSE_CLIPBOARD
97# ifdef wxABORT_ON_CONFIG_ERROR
98# error "wxUSE_CLIPBOARD must be defined."
99# else
100# define wxUSE_CLIPBOARD 0
101# endif
102#endif /* !defined(wxUSE_CLIPBOARD) */
103
104#ifndef wxUSE_COMBOBOX
105# ifdef wxABORT_ON_CONFIG_ERROR
106# error "wxUSE_COMBOBOX must be defined."
107# else
108# define wxUSE_COMBOBOX 0
109# endif
110#endif /* !defined(wxUSE_COMBOBOX) */
111
112#ifndef wxUSE_DATAOBJ
113# ifdef wxABORT_ON_CONFIG_ERROR
114# error "wxUSE_DATAOBJ must be defined."
115# else
116# define wxUSE_DATAOBJ 0
117# endif
118#endif /* !defined(wxUSE_DATAOBJ) */
119
120#ifndef wxUSE_FILEDLG
121# ifdef wxABORT_ON_CONFIG_ERROR
122# error "wxUSE_FILEDLG must be defined."
123# else
124# define wxUSE_FILEDLG 0
125# endif
126#endif /* !defined(wxUSE_FILEDLG) */
127
128#ifndef wxUSE_FONTDLG
129# ifdef wxABORT_ON_CONFIG_ERROR
130# error "wxUSE_FONTDLG must be defined."
131# else
132# define wxUSE_FONTDLG 0
133# endif
134#endif /* !defined(wxUSE_FONTDLG) */
135
136#ifndef wxUSE_FONTMAP
137# ifdef wxABORT_ON_CONFIG_ERROR
138# error "wxUSE_FONTMAP must be defined."
139# else
140# define wxUSE_FONTMAP 0
141# endif
142#endif /* !defined(wxUSE_FONTMAP) */
143
144#ifndef wxUSE_GAUGE
145# ifdef wxABORT_ON_CONFIG_ERROR
146# error "wxUSE_GAUGE must be defined."
147# else
148# define wxUSE_GAUGE 0
149# endif
150#endif /* !defined(wxUSE_GAUGE) */
151
152#ifndef wxUSE_GRID
153# ifdef wxABORT_ON_CONFIG_ERROR
154# error "wxUSE_GRID must be defined."
155# else
156# define wxUSE_GRID 0
157# endif
158#endif /* !defined(wxUSE_GRID) */
159
160#ifndef wxUSE_IMAGLIST
161# ifdef wxABORT_ON_CONFIG_ERROR
162# error "wxUSE_IMAGLIST must be defined."
163# else
164# define wxUSE_IMAGLIST 0
165# endif
166#endif /* !defined(wxUSE_IMAGLIST) */
167
168#ifndef wxUSE_LISTBOX
169# ifdef wxABORT_ON_CONFIG_ERROR
170# error "wxUSE_LISTBOX must be defined."
171# else
172# define wxUSE_LISTBOX 0
173# endif
174#endif /* !defined(wxUSE_LISTBOX) */
175
176#ifndef wxUSE_LISTCTRL
177# ifdef wxABORT_ON_CONFIG_ERROR
178# error "wxUSE_LISTCTRL must be defined."
179# else
180# define wxUSE_LISTCTRL 0
181# endif
182#endif /* !defined(wxUSE_LISTCTRL) */
183
e421922f
VZ
184#ifndef wxUSE_MSGDLG
185# ifdef wxABORT_ON_CONFIG_ERROR
186# error "wxUSE_MSGDLG must be defined."
187# else
188# define wxUSE_MSGDLG 0
189# endif
190#endif /* !defined(wxUSE_MSGDLG) */
191
1e6feb95
VZ
192#ifndef wxUSE_MDI_ARCHITECTURE
193# ifdef wxABORT_ON_CONFIG_ERROR
194# error "wxUSE_MDI_ARCHITECTURE must be defined."
195# else
196# define wxUSE_MDI_ARCHITECTURE 0
197# endif
198#endif /* !defined(wxUSE_MDI_ARCHITECTURE) */
199
200#ifndef wxUSE_MENUS
201# ifdef wxABORT_ON_CONFIG_ERROR
202# error "wxUSE_MENUS must be defined."
203# else
204# define wxUSE_MENUS 0
205# endif
206#endif /* !defined(wxUSE_MENUS) */
207
208#ifndef wxUSE_MIMETYPE
209# ifdef wxABORT_ON_CONFIG_ERROR
210# error "wxUSE_MIMETYPE must be defined."
211# else
212# define wxUSE_MIMETYPE 0
213# endif
214#endif /* !defined(wxUSE_MIMETYPE) */
215
216#ifndef wxUSE_NEW_GRID
217# ifdef wxABORT_ON_CONFIG_ERROR
218# error "wxUSE_NEW_GRID must be defined."
219# else
220# define wxUSE_NEW_GRID 0
221# endif
222#endif /* !defined(wxUSE_NEW_GRID) */
223
224#ifndef wxUSE_NOTEBOOK
225# ifdef wxABORT_ON_CONFIG_ERROR
226# error "wxUSE_NOTEBOOK must be defined."
227# else
228# define wxUSE_NOTEBOOK 0
229# endif
230#endif /* !defined(wxUSE_NOTEBOOK) */
231
232#ifndef wxUSE_POPUPWIN
233# ifdef wxABORT_ON_CONFIG_ERROR
234# error "wxUSE_POPUPWIN must be defined."
235# else
236# define wxUSE_POPUPWIN 0
237# endif
238#endif /* !defined(wxUSE_POPUPWIN) */
239
240#ifndef wxUSE_RADIOBOX
241# ifdef wxABORT_ON_CONFIG_ERROR
242# error "wxUSE_RADIOBOX must be defined."
243# else
244# define wxUSE_RADIOBOX 0
245# endif
246#endif /* !defined(wxUSE_RADIOBOX) */
247
248#ifndef wxUSE_RADIOBTN
249# ifdef wxABORT_ON_CONFIG_ERROR
250# error "wxUSE_RADIOBTN must be defined."
251# else
252# define wxUSE_RADIOBTN 0
253# endif
254#endif /* !defined(wxUSE_RADIOBTN) */
255
256#ifndef wxUSE_SASH
257# ifdef wxABORT_ON_CONFIG_ERROR
258# error "wxUSE_SASH must be defined."
259# else
260# define wxUSE_SASH 0
261# endif
262#endif /* !defined(wxUSE_SASH) */
263
264#ifndef wxUSE_SCROLLBAR
265# ifdef wxABORT_ON_CONFIG_ERROR
266# error "wxUSE_SCROLLBAR must be defined."
267# else
268# define wxUSE_SCROLLBAR 0
269# endif
270#endif /* !defined(wxUSE_SCROLLBAR) */
271
272#ifndef wxUSE_SLIDER
273# ifdef wxABORT_ON_CONFIG_ERROR
274# error "wxUSE_SLIDER must be defined."
275# else
276# define wxUSE_SLIDER 0
277# endif
278#endif /* !defined(wxUSE_SLIDER) */
279
280#ifndef wxUSE_SPINBTN
281# ifdef wxABORT_ON_CONFIG_ERROR
282# error "wxUSE_SPINBTN must be defined."
283# else
284# define wxUSE_SPINBTN 0
285# endif
286#endif /* !defined(wxUSE_SPINBTN) */
287
288#ifndef wxUSE_SPINCTRL
289# ifdef wxABORT_ON_CONFIG_ERROR
290# error "wxUSE_SPINCTRL must be defined."
291# else
292# define wxUSE_SPINCTRL 0
293# endif
294#endif /* !defined(wxUSE_SPINCTRL) */
295
296#ifndef wxUSE_SPLITTER
297# ifdef wxABORT_ON_CONFIG_ERROR
298# error "wxUSE_SPLITTER must be defined."
299# else
300# define wxUSE_SPLITTER 0
301# endif
302#endif /* !defined(wxUSE_SPLITTER) */
303
304#ifndef wxUSE_STATBMP
305# ifdef wxABORT_ON_CONFIG_ERROR
306# error "wxUSE_STATBMP must be defined."
307# else
308# define wxUSE_STATBMP 0
309# endif
310#endif /* !defined(wxUSE_STATBMP) */
311
312#ifndef wxUSE_STATBOX
313# ifdef wxABORT_ON_CONFIG_ERROR
314# error "wxUSE_STATBOX must be defined."
315# else
316# define wxUSE_STATBOX 0
317# endif
318#endif /* !defined(wxUSE_STATBOX) */
319
320#ifndef wxUSE_STATLINE
321# ifdef wxABORT_ON_CONFIG_ERROR
322# error "wxUSE_STATLINE must be defined."
323# else
324# define wxUSE_STATLINE 0
325# endif
326#endif /* !defined(wxUSE_STATLINE) */
327
328#ifndef wxUSE_STATUSBAR
329# ifdef wxABORT_ON_CONFIG_ERROR
330# error "wxUSE_STATUSBAR must be defined."
331# else
332# define wxUSE_STATUSBAR 0
333# endif
334#endif /* !defined(wxUSE_STATUSBAR) */
335
336#ifndef wxUSE_STOPWATCH
337# ifdef wxABORT_ON_CONFIG_ERROR
338# error "wxUSE_STOPWATCH must be defined."
339# else
340# define wxUSE_STOPWATCH 0
341# endif
342#endif /* !defined(wxUSE_STOPWATCH) */
343
344#ifndef wxUSE_TAB_DIALOG
345# ifdef wxABORT_ON_CONFIG_ERROR
346# error "wxUSE_TAB_DIALOG must be defined."
347# else
348# define wxUSE_TAB_DIALOG 0
349# endif
350#endif /* !defined(wxUSE_TAB_DIALOG) */
351
352#ifndef wxUSE_TEXTCTRL
353# ifdef wxABORT_ON_CONFIG_ERROR
354# error "wxUSE_TEXTCTRL must be defined."
355# else
356# define wxUSE_TEXTCTRL 0
357# endif
358#endif /* !defined(wxUSE_TEXTCTRL) */
359
360#ifndef wxUSE_TOOLBAR
361# ifdef wxABORT_ON_CONFIG_ERROR
362# error "wxUSE_TOOLBAR must be defined."
363# else
364# define wxUSE_TOOLBAR 0
365# endif
366#endif /* !defined(wxUSE_TOOLBAR) */
367
368#ifndef wxUSE_TOOLTIPS
369# ifdef wxABORT_ON_CONFIG_ERROR
370# error "wxUSE_TOOLTIPS must be defined."
371# else
372# define wxUSE_TOOLTIPS 0
373# endif
374#endif /* !defined(wxUSE_TOOLTIPS) */
375
376#ifndef wxUSE_TREECTRL
377# ifdef wxABORT_ON_CONFIG_ERROR
378# error "wxUSE_TREECTRL must be defined."
379# else
380# define wxUSE_TREECTRL 0
381# endif
382#endif /* !defined(wxUSE_TREECTRL) */
383
384/*
385 check consistency of the settings
386 */
387#if wxUSE_BUTTON || \
388 wxUSE_CALENDARCTRL || \
389 wxUSE_CARET || \
390 wxUSE_COMBOBOX || \
391 wxUSE_BMPBUTTON || \
392 wxUSE_CHECKBOX || \
393 wxUSE_CHECKLISTBOX || \
394 wxUSE_CHOICE || \
395 wxUSE_GAUGE || \
396 wxUSE_GRID || \
397 wxUSE_NEW_GRID || \
398 wxUSE_LISTBOX || \
399 wxUSE_LISTCTRL || \
400 wxUSE_NOTEBOOK || \
401 wxUSE_RADIOBOX || \
402 wxUSE_RADIOBTN || \
403 wxUSE_SCROLLBAR || \
404 wxUSE_SLIDER || \
405 wxUSE_SPINBTN || \
406 wxUSE_SPINCTRL || \
407 wxUSE_STATBMP || \
408 wxUSE_STATBOX || \
409 wxUSE_STATLINE || \
410 wxUSE_STATUSBAR || \
411 wxUSE_TEXTCTRL || \
412 wxUSE_TOOLBAR || \
413 wxUSE_TREECTRL
414# if !wxUSE_CONTROLS
415# ifdef wxABORT_ON_CONFIG_ERROR
416# error "wxUSE_CONTROLS unset but some controls used"
417# else
418# undef wxUSE_CONTROLS
419# define wxUSE_CONTROLS 1
420# endif
421# endif
422#endif /* controls */
423
424#if wxUSE_CALENDARCTRL
425# if !(wxUSE_SPINBTN && wxUSE_COMBOBOX)
426# ifdef wxABORT_ON_CONFIG_ERROR
427# error "wxCalendarCtrl requires wxSpinButton and wxComboBox"
428# else
429# undef wxUSE_SPINBTN
430# undef wxUSE_COMBOBOX
431# define wxUSE_SPINBTN 1
432# define wxUSE_COMBOBOX 1
433# endif
434# endif
435#endif /* wxUSE_CALENDARCTRL */
436
437#if wxUSE_CHECKLISTBOX
438# if !wxUSE_LISTBOX
439# ifdef wxABORT_ON_CONFIG_ERROR
440# error "wxCheckListBox requires wxListBox"
441# else
442# undef wxUSE_LISTBOX
443# define wxUSE_LISTBOX 1
444# endif
445# endif
446#endif /* wxUSE_RADIOBTN */
447
448#if wxUSE_COMBOBOX
449# if defined(__WXUNIVERSAL__) && !wxUSE_LISTBOX
450# ifdef wxABORT_ON_CONFIG_ERROR
451# error "wxComboBox requires wxListBox in wxUniversal"
452# else
453# undef wxUSE_LISTBOX
454# define wxUSE_LISTBOX 1
455# endif
456# endif
457#endif /* wxUSE_COMBOBOX */
458
459#if !wxUSE_FILEDLG
460# if defined(wxUSE_DOC_VIEW_ARCHITECTURE) || defined(wxUSE_HTML)
461# ifdef wxABORT_ON_CONFIG_ERROR
462# error "wxFileDialog must be compiled as well"
463# else
464# undef wxUSE_FILEDLG
465# define wxUSE_FILEDLG 1
466# endif
467# endif
e421922f 468#endif /* wxUSE_FILEDLG */
1e6feb95
VZ
469
470#if !wxUSE_FONTDLG
471# if defined(wxUSE_FONTMAP)
472# ifdef wxABORT_ON_CONFIG_ERROR
473# error "wxFontDialog must be compiled as well"
474# else
475# undef wxUSE_FONTDLG
476# define wxUSE_FONTDLG 1
477# endif
478# endif
479#endif /* !wxUSE_FONTDLG */
480
481#if !wxUSE_IMAGLIST
482# if wxUSE_TREECTRL || wxUSE_NOTEBOOK || wxUSE_LISTCTRL
483# ifdef wxABORT_ON_CONFIG_ERROR
484# error "wxImageList must be compiled as well"
485# else
486# undef wxUSE_IMAGLIST
487# define wxUSE_IMAGLIST 1
488# endif
489# endif
490#endif /* !wxUSE_IMAGLIST */
491
e421922f
VZ
492#if !wxUSE_MSGDLG
493# ifdef wxABORT_ON_CONFIG_ERROR
494 /* FIXME: should compile without it, of course, but doesn't */
495# error "wxMessageBox is always needed"
496# else
497# undef wxUSE_MSGDLG
498# define wxUSE_MSGDLG 1
499# endif
500#endif
501
1e6feb95
VZ
502#if wxUSE_RADIOBTN
503# if defined(__WXUNIVERSAL__) && !wxUSE_CHECKBOX
504# ifdef wxABORT_ON_CONFIG_ERROR
505# error "wxUSE_RADIOBTN requires wxUSE_CHECKBOX in wxUniversal"
506# else
507# undef wxUSE_CHECKBOX
508# define wxUSE_CHECKBOX 1
509# endif
510# endif
511#endif /* wxUSE_RADIOBTN */
512
513#if wxUSE_RADIOBOX
514# if !wxUSE_RADIOBTN || !wxUSE_STATBOX
515# ifdef wxABORT_ON_CONFIG_ERROR
516# error "wxUSE_RADIOBOX requires wxUSE_RADIOBTN and wxUSE_STATBOX"
517# else
518# undef wxUSE_RADIOBTN
519# undef wxUSE_STATBOX
520# define wxUSE_RADIOBTN 1
521# define wxUSE_STATBOX 1
522# endif
523# endif
524#endif /* wxUSE_RADIOBOX */
525
526#if wxUSE_STOPWATCH
527# if !wxUSE_LONGLONG
528# ifdef wxABORT_ON_CONFIG_ERROR
529# error "wxUSE_STOPWATCH requires wxUSE_LONGLONG"
530# else
531# undef wxUSE_LONGLONG
532# define wxUSE_LONGLONG 1
533# endif
534# endif
535#endif /* wxUSE_STOPWATCH */
536
537#if wxUSE_TEXTCTRL
538# ifdef __WXUNIVERSAL__
539# if !wxUSE_CARET
540# ifdef wxABORT_ON_CONFIG_ERROR
541# error "wxTextCtrl requires wxCaret in wxUniversal"
542# else
543# undef wxUSE_CARET
544# define wxUSE_CARET 1
545# endif
546# endif /* wxUSE_CARET */
547
548# if !wxUSE_SCROLLBAR
549# ifdef wxABORT_ON_CONFIG_ERROR
550# error "wxTextCtrl requires wxScrollBar in wxUniversal"
551# else
552# undef wxUSE_SCROLLBAR
553# define wxUSE_SCROLLBAR 1
554# endif
555# endif /* wxUSE_SCROLLBAR */
556# endif /* __WXUNIVERSAL__ */
557#endif /* wxUSE_RADIOBTN */
558
559/* I wonder if we shouldn't just remove all occurrences of
560 wxUSE_DYNAMIC_CLASSES from the sources? */
561#if !defined(wxUSE_DYNAMIC_CLASSES) || !wxUSE_DYNAMIC_CLASSES
562# if wxABORT_ON_CONFIG_ERROR
563# error "wxUSE_DYNAMIC_CLASSES must be defined as 1"
564# else
565# undef wxUSE_DYNAMIC_CLASSES
566# define wxUSE_DYNAMIC_CLASSES
567# endif
568#endif /* wxUSE_DYNAMIC_CLASSES */
569
570#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE
571# if wxABORT_ON_CONFIG_ERROR
572# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE"
573# else
574# undef wxUSE_TEXTFILE
575# define wxUSE_TEXTFILE 1
576# endif
577#endif /* wxUSE_MIMETYPE */
578
579#if wxUSE_TEXTFILE && !wxUSE_FILE
580# if wxABORT_ON_CONFIG_ERROR
581# error "wxUSE_TEXTFILE requires wxUSE_FILE"
582# else
583# undef wxUSE_FILE
584# define wxUSE_FILE 1
585# endif
586#endif /* wxUSE_TEXTFILE */
587
588#if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ
589# if wxABORT_ON_CONFIG_ERROR
590# error "wxClipboard requires wxDataObject"
591# else
592# undef wxUSE_DATAOBJ
593# define wxUSE_DATAOBJ 1
594# endif
595#endif /* wxUSE_CLIPBOARD */
596
597/* wxUniv-specific dependencies */
598#if defined(__WXUNIVERSAL__)
599# if (wxUSE_COMBOBOX || wxUSE_MENUS) && !wxUSE_POPUPWIN
600# if wxABORT_ON_CONFIG_ERROR
601# error "wxUSE_POPUPWIN must be defined to use comboboxes/menus"
602# else
603# undef wxUSE_POPUPWIN
604# define wxUSE_POPUPWIN 1
605# endif
606# endif
607#endif /* wxUSE_POPUPWIN */
608
609/* wxGTK-specific dependencies */
610#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
611# if wxUSE_MDI_ARCHITECTURE && !wxUSE_MENUS
612# if wxABORT_ON_CONFIG_ERROR
613# error "MDI requires wxUSE_MENUS in wxGTK"
614# else
615# undef wxUSE_MENUS
616# define wxUSE_MENUS 1
617# endif
618# endif
619#endif /* wxGTK && !wxUniv */
620
621#endif /* wxUSE_GUI */
622