문제

I have a C++ application using GTKmm version 3.

From one version of the library to another, some method definition change so I would like to handle them in order to allow my sources to compile with a previous and actual version of GTKmm.

When I have written a kernel module, I did the same thing using conditional operators like the following:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
  // Something is done when kernel version is 3.6 or higher
#else
  // Something else is done for older versions
#endif

So the question is: is this possible in C++ and GTKMM ?

도움이 되었습니까?

해결책

Yes - gtkmm has the defines GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, and GTKMM_MICRO_VERSION.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top