/* versionK.h - macro definitions for module version identifier */

/* Copyright 2002-2009 Kontron Modular Computers GmbH */

/*
modification history
--------------------
01g,13oct09,pwo detection of GNU compiler updated
01f,25may06,pwo KONTRON_VERS_STR_H macro corrected
01e,26apr05,phd copied from versionPep.h
01d,10feb03,phd support for Diab compiler added
01c,22oct02,phd else case for _ASMLANGUAGE added
01b,01aug02,phd copyright adjusted
01a,26jun02,phd initially created
*/

#ifndef __INCversionK_h
#define __INCversionK_h

#ifdef __cplusplus
extern "C" {
#endif

#ifndef _ASMLANGUAGE

/* version macro defintions */

#define KONTRON_VERS_VARNAME_H(v,m,u) KONTRON_VERS_##m##u##v
#define KONTRON_VERS_VARNAME(v,m) KONTRON_VERS_VARNAME_H(v,m,_)

#define KONTRON_VERS_STR_H(m,v) "$KONTRON_VERSION: " #m " " #v " $"
#define KONTRON_VERS_STR(m,v) KONTRON_VERS_STR_H(m,v)

#ifdef __GNUC__

#define KONTRON_VERSION(KONTRON_MODNAME,KONTRON_VER_ID)\
	static volatile const char KONTRON_VERS_VARNAME(KONTRON_MODNAME,KONTRON_VER_ID)[]\
	__attribute__ ((used)) = KONTRON_VERS_STR(KONTRON_MODNAME,KONTRON_VER_ID);

#else

#define KONTRON_VERSION(KONTRON_MODNAME,KONTRON_VER_ID)\
	static volatile const char KONTRON_VERS_VARNAME(KONTRON_MODNAME,KONTRON_VER_ID)[]\
							 = KONTRON_VERS_STR(KONTRON_MODNAME,KONTRON_VER_ID);

#endif	/* __GNUC__ */

/* version identifier */

KONTRON_VERSION(versionK_h,01g)

#else

#define KONTRON_VERSION(KONTRON_MODNAME,KONTRON_VER_ID)

#endif /* _ASMLANGUAGE */

#ifdef __cplusplus
}
#endif

#endif /* __INCversionK_h */
