/*
 *               Copyright (C) 2008, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished proprietary information of BroadOn Communications Corp.,
 *  and are protected by federal copyright law. They may not be disclosed
 *  to third parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 *  Description:
 *      Macros for defining version numbers and version strings
 */

#ifndef __MODVERSION_H__
#define __MODVERSION_H__

#ifndef __STRING
#define __STRING(n)  #n
#endif

/*
 * Releases are numbered major.minor.patch
 *
 * Use the macros here to define version numbers and version strings for libraries
 * and exported APIs
 */

/*
 * Use this to embed a version string in an object file, e.g.:
 *
 * static char *__version = MODULE_VERSION_STRING("mymod", 3, 2, 4);
 */
#define MODULE_VERSION_STRING(name, major, minor, patch)  name " " __STRING(major) "." __STRING(minor) "." __STRING(patch) " " __DATE__ " " __TIME__

/*
 * Use this form to create a numeric representation that can be used for comparisons
 */
#define MODULE_VERSION_NUMBER(major, minor, patch)  ( (major)<<16 | (minor)<<8 | patch )

#define USER_AGENT_STRING(platform, name, major, minor, patch)  platform " " MODULE_VERSION_STRING(name, major, minor, patch)
#endif /* __MODVERSION_H__ */
