sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
291 stars 27 forks source link

Timestamp variable name breaks build #156

Closed monkman71 closed 6 years ago

monkman71 commented 6 years ago

DISCLAIMER: I am not very C-savvy, so I apologize if I am just doing something stupid.

While trying to build this on Arch Linux, I found that the variable name for the unix timestamp in discord-util.c breaks the build.

According to the preprocessor, this is the name of a built-in constant. Renaming the variable fixed the issue on my system.

Tested on gcc 7.3.0 and 8.1.0.

$ gcc -dM -E `pkg-config --cflags glib-2.0 bitlbee` bitlbee-discord/src/discord-util.c | grep -w unix 
#define unix 1

See line 392.

Alcaro commented 6 years ago

ughhhhhhhhhhh lol, yeah, that's a bug and it's my fault, I submitted that code earlier this week and forgot those silly predefined macros exist. I always build with -std=c99 where that name isn't reserved (testing didn't catch it either, my computer only builds the other branch of that #if).

Submitted #157.

monkman71 commented 6 years ago

Awesome. Thanks for the quick reply. Your fix in #157 seems reasonable, but I'm in no place to comment on design choices for the project. haha

(Assuming your profile is correct, sorry to bother you so early in the morning :P)