[SERVER-3671] change VERSION to PDFILE_VERSION Created: 22/Aug/11  Updated: 11/Jul/16  Resolved: 22/Oct/11

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Bug Priority: Minor - P4
Reporter: Adam Magaluk Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian Linux Squeeze 32bit


Operating System: ALL
Participants:

 Description   

Seems to be some comparability with linking against your library when using autoconf as autoconf defines VERSION.

In file pch.h on lines 106

// pdfile versions
const int VERSION = 4;

Its bad practice to declare a constant as common as VERSION without even doing a #ifdef before.

My suggestion would be to rename VERSION to PDFILE_VERSION.



 Comments   
Comment by auto [ 22/Oct/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: use PDFILE_VERSION instead of VERSION since its such a common name SERVER-3671
Branch: master
https://github.com/mongodb/mongo/commit/a1e68969d48bbb47c893870f6428048a602faf90

Comment by Eliot Horowitz (Inactive) [ 22/Aug/11 ]

we can change.

Comment by Adam Magaluk [ 22/Aug/11 ]

Another possible fix to allow mongo::VERSION to still be declared as such,

#ifdef VERSION
#define _TMP_VERSION VERSION
#undef VERSION
const int VERSION = 4;
const int VERSION_MINOR = 5;
#define VERSION _TMP_VERSION
#else
const int VERSION = 4;
const int VERSION_MINOR = 5;
#endif

Comment by Adam Magaluk [ 22/Aug/11 ]

I see that, but if VERSION is defined using a preprocessor then it generates an error.

I put #define VERSION in my header or generated by autoconf before including mong/client/dbclient.h

/usr/include/mongo/client/../pch.h:108: error: expected unqualified-id before numeric constant

Compiling with gcc version 4.4.5 (Debian 4.4.5-8)

Comment by Eliot Horowitz (Inactive) [ 22/Aug/11 ]

Its inside of a namespace, so its not VERSION its mongo::VERSION

Generated at Thu Feb 08 03:03:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.