Skip to content
Browse files

Various tweaks for building with clang

* Change non-static inline function bp_sched2ix to macro and move
  to header file
* '-no-cpp-precomp' no longer needed since Apple GCC 3.3. It results
  many warning when building with clang.
* cast to (void*) in GoTo macro
* Use `void' for empty parameter declaration instead of _VOID_.
  Clang generates an error for a parameter list without types in
  function declaration, while gcc generates a warning.
  • Loading branch information...
1 parent a3d8134 commit d57d2f47fd4a0fd28bfeeb3b5ebbe8201463dcb7 @lht committed Sep 6, 2010
View
1 erts/configure.in
@@ -497,7 +497,6 @@ CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R"
case $host_os in
darwin*)
CFLAG_RUNTIME_LIBRARY_PATH=
- CFLAGS="$CFLAGS -no-cpp-precomp"
;;
win32)
CFLAG_RUNTIME_LIBRARY_PATH=
View
10 erts/emulator/beam/beam_bp.c
@@ -495,16 +495,6 @@ erts_find_local_func(Eterm mfa[3]) {
return NULL;
}
-/* bp_hash */
-ERTS_INLINE Uint bp_sched2ix() {
-#ifdef ERTS_SMP
- ErtsSchedulerData *esdp;
- esdp = erts_get_scheduler_data();
- return esdp->no - 1;
-#else
- return 0;
-#endif
-}
static void bp_hash_init(bp_time_hash_t *hash, Uint n) {
Uint size = sizeof(bp_data_time_item_t)*n;
Uint i;
View
6 erts/emulator/beam/beam_bp.h
@@ -144,7 +144,11 @@ extern erts_smp_spinlock_t erts_bp_lock;
#define ErtsSmpBPUnlock(BDC)
#endif
-ERTS_INLINE Uint bp_sched2ix(void);
+#ifdef ERTS_SMP
+#define bp_sched2ix() (erts_get_scheduler_data()->no - 1)
+#else
+#define bp_sched2ix() (0)
+#endif
#ifdef ERTS_SMP
#define bp_sched2ix_proc(p) ((p)->scheduler_data->no - 1)
View
2 erts/emulator/beam/beam_emu.c
@@ -52,7 +52,7 @@
#else
# define OpCase(OpCode) lb_##OpCode
# define CountCase(OpCode) lb_count_##OpCode
-# define Goto(Rel) goto *(Rel)
+# define Goto(Rel) goto *((void*)Rel)
# define LabelAddr(Label) &&Label
# define OpCode(OpCode) (&&lb_##OpCode)
#endif
View
3 erts/emulator/beam/erl_nif.c
@@ -1616,7 +1616,8 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
}
else { /* Function traced, patch the original instruction word */
BpData** bps = (BpData**) code_ptr[1];
- BpData* bp = (BpData*) bps[bp_sched2ix()];
+ int bpi = bp_sched2ix();
+ BpData* bp = (BpData*) bps[bpi];
bp->orig_instr = (BeamInstr) BeamOp(op_call_nif);
}
code_ptr[5+1] = (BeamInstr) entry->funcs[i].fptr;
View
6 lib/erl_interface/configure.in
@@ -338,12 +338,6 @@ AC_SUBST(LIB_CFLAGS)
if test "X$host" = "Xwin32"; then
LIB_CFLAGS="$CFLAGS"
else
- case $host_os in
- darwin*)
- CFLAGS="$CFLAGS -no-cpp-precomp"
- ;;
- esac
-
if test "x$GCC" = xyes; then
LIB_CFLAGS="$CFLAGS -fPIC"
else
View
6 lib/megaco/configure.in
@@ -206,12 +206,6 @@ dnl
if test "X$host" = "Xwin32"; then
DED_CFLAGS="$CFLAGS"
else
- case $host_os in
- darwin*)
- CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
- ;;
- esac
-
if test "x$GCC" = xyes; then
DED_CFLAGS="$CFLAGS -fPIC $DED_CFLAGS"
else
View
1 lib/wx/configure.in
@@ -161,7 +161,6 @@ esac
case $host_os in
darwin*)
- CFLAGS="-no-cpp-precomp $CFLAGS"
LDFLAGS="-bundle -flat_namespace -undefined warning -fPIC $LDFLAGS"
GL_LIBS="-framework OpenGL"
;;

0 comments on commit d57d2f4

Please sign in to comment.
Something went wrong with that request. Please try again.