mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 05:18:06 +01:00
Fixed improper variables definition in header file
Some header were creating variable, this is a bad practice which
is likely to not behave as expected. This creates one distinct
variable in each object file that used the header, and:
- on well behaved compiler, this ends up in a link error (see
commit 39fdb451ba for an example)
- on bad behaving compiler, this can be linked as multiple local
variable, thus having strange effects when running program
- on insouciant compiler (who said gcc?) the variables are
silently merged, hiding portability issues
This commit is contained in:
committed by
Carlos R. Mafra
parent
8238e4681a
commit
80a59696e5
@@ -81,6 +81,11 @@ extern int wScreenCount;
|
|||||||
extern int wXkbSupported;
|
extern int wXkbSupported;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_XRANDR
|
||||||
|
Bool has_randr;
|
||||||
|
int randr_event_base;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern WDDomain *WDWindowMaker;
|
extern WDDomain *WDWindowMaker;
|
||||||
|
|
||||||
/**** Local ****/
|
/**** Local ****/
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
#define WTB_MENU 6
|
#define WTB_MENU 6
|
||||||
|
|
||||||
#ifdef HAVE_XRANDR
|
#ifdef HAVE_XRANDR
|
||||||
Bool has_randr;
|
extern Bool has_randr;
|
||||||
int randr_event_base;
|
extern int randr_event_base;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ char *terminal;
|
|||||||
|
|
||||||
extern char *__progname;
|
extern char *__progname;
|
||||||
|
|
||||||
|
/* Global Variables from wmmenugen.h */
|
||||||
|
WMTreeNode *menu;
|
||||||
|
char *env_lang, *env_ctry, *env_enc, *env_mod;
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ typedef struct {
|
|||||||
|
|
||||||
/* the abstract menu tree
|
/* the abstract menu tree
|
||||||
*/
|
*/
|
||||||
WMTreeNode *menu;
|
extern WMTreeNode *menu;
|
||||||
|
|
||||||
char *env_lang, *env_ctry, *env_enc, *env_mod;
|
extern char *env_lang, *env_ctry, *env_enc, *env_mod;
|
||||||
|
|
||||||
/* wmmenu_misc.c
|
/* wmmenu_misc.c
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user