Skip to content

Commit

Permalink
Merge pull request #33 from pkgw/fix-macos
Browse files Browse the repository at this point in the history
Fix macOS
  • Loading branch information
pkgw committed Feb 24, 2018
2 parents ba74031 + c470f91 commit a191acf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aipy_src/_deconv/deconv.cpp
Expand Up @@ -6,6 +6,7 @@
*/

#include <Python.h>
#include <cmath>
#include "numpy/arrayobject.h"

#define QUOTE(s) # s
Expand Down Expand Up @@ -103,7 +104,7 @@ template<typename T> struct Clean {
printf("Iter %d: Max=(%d,%d,%f), Score=%f, Prev=%f, Delta=%f\n", \
i, nargmax1, nargmax2, (double) max, (double) (nscore/firstscore), \
(double) (score/firstscore),
(double) (fabs(score - nscore) / firstscore));
(double) (std::abs(score - nscore) / firstscore));
if (score > 0 && nscore > score) {
if (stop_if_div) {
// We've diverged: undo last step and give up
Expand All @@ -130,7 +131,7 @@ template<typename T> struct Clean {
best_score = score;
i = 0; // Reset maxiter counter
}
} else if (score > 0 && fabs(score - nscore) / firstscore < tol) {
} else if (score > 0 && std::abs(score - nscore) / firstscore < tol) {
// We're done
if (best_mdl != NULL) { free(best_mdl); free(best_res); }
return i;
Expand Down
5 changes: 5 additions & 0 deletions aipy_src/_miriad/mir/miriad.h
Expand Up @@ -42,6 +42,11 @@
#include <stdarg.h>
#include "sysdep.h" /* since it now contains the "pack.c" prototypes */

#ifdef __APPLE__
#define off64_t off_t
#define lseek64 lseek
#endif

/* Define const and void if needed. */

#ifndef MIRIAD_TYPES_DEFINED
Expand Down

0 comments on commit a191acf

Please sign in to comment.