Răsfoiți Sursa

fixes for MacOS

Erik Rodner 12 ani în urmă
părinte
comite
0f14f1f6fb

+ 2 - 1
Makefile

@@ -257,7 +257,8 @@ moc_%.cpp:%.h
 $(BUILDDIR)%.a:
 	@$(MKOUTPUTDIR)
 	$(VERBOSE)echo "+++ linking library $@"
-	$(VERBOSE2)$(AR) cr $@ $(filter %.o,$^)
+	$(VERBOSE2)test -n "$(filter %.o,$^)" && $(AR) -crs $@ $(filter %.o,$^); echo;
+	$(VERBOSE2)test -f "$@" || (touch emptysource.cpp; gcc -c emptysource.cpp; $(AR) -crs $@ emptysource.o; rm emptysource.*); echo
 	@touch $@
 	@$(call MKOUTPUTDIR2,$(LIBSYMLINKDIR))
 	$(VERBOSE2)cd $(LIBSYMLINKDIR);$(SYMLINK) ../$(@:$(BUILDDIR)%=%) $(@F)

+ 2 - 0
core/basics/numerictools.cpp

@@ -13,6 +13,8 @@
 #include <core/basics/Exception.h>
 #include <core/basics/Streamable.h>
 
+typedef unsigned int uint;
+
 namespace NICE {
 
 // check if endptr is empty string (except for whitespaces)

+ 3 - 3
core/basics/numerictools.h

@@ -7,7 +7,7 @@
  */
 
 #include <cmath>
-// #include <math.h>
+#include <math.h>
 #include <stdlib.h>
 #include <limits>
 #include <string>
@@ -204,7 +204,7 @@ inline double cubeRoot(const double& t) {
  */
 inline bool isNaN(double x) {
 #if (__GNUC__ > 3)
-  return isnan(x);
+  return std::isnan(x);
 #else
   return x != x;
 #endif
@@ -215,7 +215,7 @@ inline bool isNaN(double x) {
  */
 inline bool isNaN(float x) {
 #if (__GNUC__ > 3)
-  return isnan(x);
+  return std::isnan(x);
 #else
   return x != x;
 #endif

+ 2 - 0
core/basics/tools.cpp

@@ -5,6 +5,8 @@
  */
 #include <core/basics/tools.h>
 
+typedef unsigned int uint;
+
 namespace NICE {
 
 void writeLatexTabular(std::ostream& out,

+ 3 - 3
core/optimization/libdepend.inc

@@ -1,3 +1,3 @@
- $(call PKG_DEPEND_EXT,LINAL)
- $(call PKG_DEPEND_INT,core/vector)
- $(call PKG_DEPEND_INT,core/basics)
+$(call PKG_DEPEND_EXT,LINAL)
+$(call PKG_DEPEND_INT,core/vector)
+$(call PKG_DEPEND_INT,core/basics)