Merge lp:~kreeblah/smpq/macos_compilation_fix into lp:smpq

Proposed by Kreeblah
Status: Needs review
Proposed branch: lp:~kreeblah/smpq/macos_compilation_fix
Merge into: lp:smpq
Diff against target: 29 lines (+8/-0)
2 files modified
common.h (+4/-0)
remove.c (+4/-0)
To merge this branch: bzr merge lp:~kreeblah/smpq/macos_compilation_fix
Reviewer Review Type Date Requested Status
Pali Pending
Review via email: mp+455834@code.launchpad.net

Description of the change

This fixes compilation on macOS. It adds a couple of macOS define guards to include a header in two files that need it.

To post a comment you must log in.
Revision history for this message
Pali (pali) wrote :

Hello, could you provide the compile error output log which you got?

Both stdio.h and string.h are standard C header files, nothing macOS specific, so I have feeling that something may be somewhere missing and it does not have to affect only macOS.

Revision history for this message
Kreeblah (kreeblah) wrote :

Well, at the time, I was getting errors about undeclared uses of methods. But, now that I'm trying again to get the specific error, I can't replicate that.

I'm also on a much newer version of clang, though, so apparently modern versions can build the 1.6 code as-is. I guess this doesn't need to be merged after all.

Revision history for this message
Pali (pali) wrote :

> Well, at the time, I was getting errors about undeclared uses of methods.

It would be nice to know which methods...

Would you be able to figure out which clang version has issue?

Revision history for this message
Pali (pali) wrote :

remove.c is calling strlen(), so string.h should be really included in remove.c

But common.h is included everywhere so hard to guess which file triggered compile error.

Revision history for this message
Kreeblah (kreeblah) wrote :

> Would you be able to figure out which clang version has issue?

Let me check and see. This might take me a bit to find out. Based on when I filed this, I expect I was on Xcode 13.2.1, which includes clang 13, however Apple doesn't always include libcxx versions that correspond with the same LLVM/clang versions, so I'll need to see what version of libcxx they included with that Xcode version.

Revision history for this message
Pali (pali) wrote :

I would like to ask, were you able to check it?

Unmerged revisions

140. By Kreeblah

macOS compilation fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common.h'
2--- common.h 2016-12-13 00:09:12 +0000
3+++ common.h 2023-11-19 23:36:38 +0000
4@@ -26,6 +26,10 @@
5 #define inline __inline__
6 #endif
7
8+#if defined(__APPLE__) && defined(__MACH__)
9+#include <stdio.h>
10+#endif
11+
12 /*********
13 * Flags *
14 *********/
15
16=== modified file 'remove.c'
17--- remove.c 2016-03-27 19:14:10 +0000
18+++ remove.c 2023-11-19 23:36:38 +0000
19@@ -19,6 +19,10 @@
20
21 #include <StormLib.h>
22
23+#if defined(__APPLE__) && defined(__MACH__)
24+#include <string.h>
25+#endif
26+
27 #include "common.h"
28
29 int smpq_remove(const char * archive, const char * const files[], unsigned int flags, const char * listfile, unsigned int locale) {

Subscribers

People subscribed via source and target branches

to all changes: