jbagg / QtZeroConf

Qt wrapper class for ZeroConf libraries across various platforms.
Other
70 stars 51 forks source link

undefine the 'interface' macro present when compiling with msvc #5

Closed cameronklein closed 7 years ago

cameronklein commented 7 years ago

A bit of a problem when compiling on Windows. interface is defined as struct, which throws everything off inside the QZeroConfService struct.

This will helpfully undefine interface and allow compilation. The other solution, of course, is to rename the interface variable.

jbagg commented 7 years ago

I could probably just rename variable interface for msvc. Your solution is nice and simple, but I hate using toolchain names in the source. I suspect I only built and tested with mingw.

1-2 weeks ago another individual found that the iOS section was missing. He had some other issues building as a library. I've ordered Mountain Lion upgrade for my Snow Leopard mac so I can build Qt projects for iOS. Still waiting for the mail to come. Give me some time, I'll get to your pull request.

Jon

On 2017-02-24 03:32 PM, Cameron Klein wrote:

A bit of a problem when compiling on Windows. |interface| is defined as |struct|, which throws everything off inside the QZeroConfService struct.

This will helpfully undefine |interface| and allow compilation. The other solution, of course, is to rename the interface variable.


    You can view, comment on, or merge this pull request online at:

https://github.com/jbagg/QtZeroConf/pull/5

    Commit Summary

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbagg/QtZeroConf/pull/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AMpF84AoFERNMNaVfoFiDP3SfmzMdt4iks5rfz56gaJpZM4MLpTI.

cameronklein commented 7 years ago

Yeah, good call.

In retrospect, I was looking at this through the lens of cross-platform development. There may be Windows-only projects that use the interface keyword. Having that #undef would break all sorts of stuff.

No hurry! I've got this working on Android, iOS, MacOS, and Windows (with that tweak), and it works like a charm! Thanks much!

jbagg commented 7 years ago

Cameron,

I pushed a fix for msvc.

On 17-02-24 06:29 PM, Cameron Klein wrote:

Yeah, good call.

In retrospect, I was looking at this through the lens of cross-platform development. There may be Windows-only projects that use the |interface| keyword. Having that |#undef| would break all sorts of stuff.

No hurry! I've got this working on Android, iOS, MacOS, and Windows (with that tweak), and it works like a charm! Thanks much!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbagg/QtZeroConf/pull/5#issuecomment-282433603, or mute the thread https://github.com/notifications/unsubscribe-auth/AMpF89QzCb-N3fRWYIIwD4aylgI551deks5rf2e_gaJpZM4MLpTI.

cameronklein commented 7 years ago

Looks good! Closing.

jbagg commented 7 years ago

Cameron,

Can you tell me which version of Windows and msvc you are using? Someone else is having trouble with includes.

On 17-02-27 11:49 AM, Cameron Klein wrote:

Looks good! Closing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbagg/QtZeroConf/pull/5#issuecomment-282777834, or mute the thread https://github.com/notifications/unsubscribe-auth/AMpF8y7b8GBMQyH_aG8NjAf99oUlG7tEks5rgv6tgaJpZM4MLpTI.

cameronklein commented 7 years ago

I'm on msvc2015_64 and Windows 10.