libftdi Archives

Subject: [PATCH] added function-call to access version information

From: Martin Zenzes <mzenzes@xxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 01 Jul 2010 12:50:59 +0200

I had some trouble with different versions of libftdi installed on the
same system -- leading to confusion because i didn't notice the wrong
version of the library was linked. I found no way to extract the
versionnumber as a normal user.

I modified the code to provide the minor and major version number to the
user trough a normal functioncall. Therefore, I introduced a new
headerfile, which is generated by cmake. Two preprocessor #defines
MAJOR_VERSION and MINOR_VERSION are build from the ones provided in
CMakeLists.txt. They can be accessed by a call to
ftdi_library_version(int* major, int* minor)

The technique used to provide version information is taken from
online-tutorial, see

I'm sure, my solution is far from perfect, but it works for me. Sending
the patch to provide some input for a discussion about how to implement
his properly. See the patch for more details, its not very complicated.

There are currently two TODOs:
- I only use cmake, but there are people using autotools, I suppose...
- Nicer would be to provide the git-hash of the current source, like
openocd does. Doing this, the information is more precise.

I added a second, trivial patch to git-ignore vim's temporary


libftdi - see for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Attachment: 0001-added-function-call-to-access-version-information.patch
Description: Text Data

Attachment: 0002-gitignore-temporary-swp-files-created-by-vim.patch
Description: Text Data

Current Thread