1
0
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:
Christophe CURIS
2013-05-11 00:07:15 +02:00
committed by Carlos R. Mafra
parent 8238e4681a
commit 80a59696e5
4 changed files with 13 additions and 4 deletions

View File

@@ -81,6 +81,11 @@ extern int wScreenCount;
extern int wXkbSupported;
#endif
#ifdef HAVE_XRANDR
Bool has_randr;
int randr_event_base;
#endif
extern WDDomain *WDWindowMaker;
/**** Local ****/

View File

@@ -36,8 +36,8 @@
#define WTB_MENU 6
#ifdef HAVE_XRANDR
Bool has_randr;
int randr_event_base;
extern Bool has_randr;
extern int randr_event_base;
#endif
typedef struct {

View File

@@ -45,6 +45,10 @@ char *terminal;
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)
{
struct stat st;

View File

@@ -46,9 +46,9 @@ typedef struct {
/* 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
*/