Skip to content

Commit

Permalink
My change to 477174 did not work. Keep our C++ copies of xwax files a…
Browse files Browse the repository at this point in the history
…nd wrap them with extern C.
  • Loading branch information
rryan committed Mar 29, 2014
1 parent ce3c119 commit e359108
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def sources(self, build):
'vinylcontrol/steadypitch.cpp',
'engine/vinylcontrolcontrol.cpp', ]
if build.platform_is_windows:
sources.append("#lib/xwax/timecoder_win32.c")
sources.append("#lib/xwax/lut_win32.c")
sources.append("#lib/xwax/timecoder_win32.cpp")
sources.append("#lib/xwax/lut_win32.cpp")
else:
sources.append("#lib/xwax/timecoder.c")
sources.append("#lib/xwax/lut.c")
Expand Down
4 changes: 4 additions & 0 deletions lib/xwax/lut.c → lib/xwax/lut_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

extern "C" {

#include <stdio.h>
#include <stdlib.h>

Expand Down Expand Up @@ -109,3 +111,5 @@ unsigned int lut_lookup(struct lut *lut, unsigned int timecode)

return (unsigned)-1;
}

}; // extern "C"
8 changes: 8 additions & 0 deletions lib/xwax/timecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

#define TIMECODER_CHANNELS 2

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

typedef unsigned int bits_t;

struct timecode_def {
Expand Down Expand Up @@ -143,4 +147,8 @@ static inline double timecoder_revs_per_sec(struct timecoder *tc)
return (33.0 + 1.0 / 3) * tc->speed / 60;
}

#ifdef __cplusplus
};
#endif // __cplusplus

#endif
4 changes: 4 additions & 0 deletions lib/xwax/timecoder_win32.c → lib/xwax/timecoder_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

extern "C" {

#include <assert.h>
#include <limits.h>
#include <stdio.h>
Expand Down Expand Up @@ -642,3 +644,5 @@ signed int timecoder_get_position(struct timecoder *tc, double *when)

return r;
}

}; // extern "C"

0 comments on commit e359108

Please sign in to comment.