From 8272cd7d8df44c9952c316ee23fb3602e7649914 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Tue, 26 Feb 2008 16:09:29 -0300 Subject: [PATCH] Allow globals.h to be included by multiple files Also move data definition to proper file and protect agains't multiple inclusions. --- src/globals.h | 17 ++++------------- src/sm_client.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/globals.h b/src/globals.h index ec00fe2..8dc0d5f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -31,6 +31,9 @@ in this Software without prior written authorization from The Open Group. * Author: Ralph Mor, X Consortium */ +#ifndef _ICEGLOBALS_H_ +#define _ICEGLOBALS_H_ + extern void _SmcDefaultErrorHandler( SmcConn /* smcConn */, Bool /* swap */, @@ -51,16 +54,4 @@ extern void _SmsDefaultErrorHandler ( SmPointer /* values */ ); -int _SmcOpcode = 0; -int _SmsOpcode = 0; - -#ifndef __UNIXOS2__ -SmsNewClientProc _SmsNewClientProc; -SmPointer _SmsNewClientData; -#else -SmsNewClientProc _SmsNewClientProc = 0; -SmPointer _SmsNewClientData = 0; -#endif - -SmcErrorHandler _SmcErrorHandler = _SmcDefaultErrorHandler; -SmsErrorHandler _SmsErrorHandler = _SmsDefaultErrorHandler; +#endif /* _ICEGLOBALS_H_ */ diff --git a/src/sm_client.c b/src/sm_client.c index ca11bb3..8dbc4a0 100644 --- a/src/sm_client.c +++ b/src/sm_client.c @@ -67,6 +67,21 @@ static void set_callbacks ( ); +int _SmcOpcode = 0; +int _SmsOpcode = 0; + +#ifndef __UNIXOS2__ +SmsNewClientProc _SmsNewClientProc; +SmPointer _SmsNewClientData; +#else +SmsNewClientProc _SmsNewClientProc = 0; +SmPointer _SmsNewClientData = 0; +#endif + +SmcErrorHandler _SmcErrorHandler = _SmcDefaultErrorHandler; +SmsErrorHandler _SmsErrorHandler = _SmsDefaultErrorHandler; + + SmcConn SmcOpenConnection ( -- 1.5.4.3