reidmorrison / rubywmq

Ruby interface into WebSphere MQ
https://github.com/reidmorrison/rubywmq
Apache License 2.0
32 stars 24 forks source link

Extconf fix #11

Closed zeroalpha closed 9 years ago

zeroalpha commented 9 years ago

Enalbed correct Handling of --with-mqm-include option by using the return values from dir_config()

reidmorrison commented 9 years ago

Looks great, always welcome Windows fixes / commits. Can you revert / exclude the changes to rubywmq.gemspec ?

zeroalpha commented 9 years ago

Done.

zeroalpha commented 9 years ago

In my client libraries (Windows MQC 7.0.1.12) there no String "General Constants" anywhere in the 'cmqc.h' header file.

This causes the GenerateConst#admin_consts method to hand lines like this

 #define MQCHARV_DEFAULT NULL,\
                         0,\
                         0,\
                         0,\
                         MQCCSI_APPL

to GenerateConst#extract_const which then builds the constants_admin.rb containing undefined Constants like this

   MQCHARV_DEFAULT                = NULL

Instead of limiting the range of lines passed to GenerateConst#extract_const one may alter the Regex inside GenerateConst#extract_const to make sure lines ending in \ are excluded. (I am not good with C/C++ i don't even quite get, what that line in the Header file is defining)

reidmorrison commented 9 years ago

I have not forgotten about this issue. The ideal solution is to use an actual C header file parser instead of just regular expressions to try and extract the latest structure and codes with each MQ version.

reidmorrison commented 9 years ago

I installed MQ Advanced V8 on Windows 7 64bit and cmqc.h contains the following line at around 3033:

 /* General Constants */

It uses the General Constants marker to stop it from trying to parse further down the file, which is what is causing the error you are seeing above. The parser is not designed to extract MQCHARV_DEFAULT, and we do not want that constant in the constants file.

reidmorrison commented 9 years ago

I just release V2.1 of rubywmq and tested it on Windows 7 64bit with following command, and it works great:

gem install rubywmq

Tested against both MQ V7.5 and V 8

zeroalpha commented 9 years ago

I am using the MQ Libraries for 7.0.1 and the cmqc.h file does not contain the String "General Constants" at all, which was why i tried to find another marker to mark the end of constant definitions

reidmorrison commented 9 years ago

Suggest upgrading to MQ V7.5 or even V8 since it is now freely available for development use.