comparison src/gui-x.c @ 551:e9a3f8b4de53

[xemacs-hg @ 2001-05-21 05:26:06 by martinb] realloc() handling on sunos4; remove lwlib-config kludge
author martinb
date Mon, 21 May 2001 05:26:51 +0000
parents 576fb035e263
children 183866b06e0b
comparison
equal deleted inserted replaced
550:1638aacf421d 551:e9a3f8b4de53
661 unbind_to (count, Qnil); 661 unbind_to (count, Qnil);
662 662
663 return control; 663 return control;
664 } 664 }
665 665
666 /* This is a kludge to make sure emacs can only link against a version of
667 lwlib that was compiled in the right way. Emacs references symbols which
668 correspond to the way it thinks lwlib was compiled, and if lwlib wasn't
669 compiled in that way, then somewhat meaningful link errors will result.
670 The alternatives to this range from obscure link errors, to obscure
671 runtime errors that look a lot like bugs.
672 */
673
674 static void
675 sanity_check_lwlib (void)
676 {
677 #define MACROLET(v) { extern int v; v = 1; }
678
679 #if (XlibSpecificationRelease == 4)
680 MACROLET (lwlib_uses_x11r4);
681 #elif (XlibSpecificationRelease == 5)
682 MACROLET (lwlib_uses_x11r5);
683 #elif (XlibSpecificationRelease == 6)
684 MACROLET (lwlib_uses_x11r6);
685 #else
686 MACROLET (lwlib_uses_unknown_x11);
687 #endif
688 #ifdef LWLIB_USES_MOTIF
689 MACROLET (lwlib_uses_motif);
690 #else
691 MACROLET (lwlib_does_not_use_motif);
692 #endif
693 #if (XmVersion >= 1002)
694 MACROLET (lwlib_uses_motif_1_2);
695 #else
696 MACROLET (lwlib_does_not_use_motif_1_2);
697 #endif
698 #ifdef LWLIB_MENUBARS_LUCID
699 MACROLET (lwlib_menubars_lucid);
700 #elif defined (HAVE_MENUBARS)
701 MACROLET (lwlib_menubars_motif);
702 #endif
703 #ifdef LWLIB_SCROLLBARS_LUCID
704 MACROLET (lwlib_scrollbars_lucid);
705 #elif defined (LWLIB_SCROLLBARS_MOTIF)
706 MACROLET (lwlib_scrollbars_motif);
707 #elif defined (HAVE_SCROLLBARS)
708 MACROLET (lwlib_scrollbars_athena);
709 #endif
710 #ifdef LWLIB_DIALOGS_MOTIF
711 MACROLET (lwlib_dialogs_motif);
712 #elif defined (HAVE_DIALOGS)
713 MACROLET (lwlib_dialogs_athena);
714 #endif
715 #ifdef LWLIB_WIDGETS_MOTIF
716 MACROLET (lwlib_widgets_motif);
717 #elif defined (HAVE_WIDGETS)
718 MACROLET (lwlib_widgets_athena);
719 #endif
720
721 #undef MACROLET
722 }
723
724 void 666 void
725 syms_of_gui_x (void) 667 syms_of_gui_x (void)
726 { 668 {
727 INIT_LRECORD_IMPLEMENTATION (popup_data); 669 INIT_LRECORD_IMPLEMENTATION (popup_data);
728 } 670 }
732 { 674 {
733 lwlib_id_tick = (1<<16); /* start big, to not conflict with Energize */ 675 lwlib_id_tick = (1<<16); /* start big, to not conflict with Energize */
734 #ifdef HAVE_POPUPS 676 #ifdef HAVE_POPUPS
735 popup_up_p = 0; 677 popup_up_p = 0;
736 #endif 678 #endif
737
738 /* this makes only safe calls as in emacs.c */
739 sanity_check_lwlib ();
740 } 679 }
741 680
742 void 681 void
743 vars_of_gui_x (void) 682 vars_of_gui_x (void)
744 { 683 {