diff --git a/tools/widl/utils.h b/tools/widl/utils.h index 1cd3dd3827c..7d6ce5c5f30 100644 --- a/tools/widl/utils.h +++ b/tools/widl/utils.h @@ -46,8 +46,10 @@ size_t widl_getline(char **linep, size_t *lenp, FILE *fp); UUID *parse_uuid(const char *u); int is_valid_uuid(const char *s); -#define MAKEVERSION(major, minor) ((((major) & 0xffff) << 16) | ((minor) & 0xffff)) -#define MAJORVERSION(version) (((version) >> 16) & 0xffff) -#define MINORVERSION(version) ((version) & 0xffff) +/* typelibs expect the minor version to be stored in the higher bits and + * major to be stored in the lower bits */ +#define MAKEVERSION(major, minor) ((((minor) & 0xffff) << 16) | ((major) & 0xffff)) +#define MAJORVERSION(version) ((version) & 0xffff) +#define MINORVERSION(version) (((version) >> 16) & 0xffff) #endif