Index: include/bn.h
===================================================================
--- include/bn.h	(Revision 59269)
+++ include/bn.h	(Arbeitskopie)
@@ -4653,6 +4653,19 @@
 BN_EXPORT extern int bn_polygon_mk_pts_planes(size_t *npts, point_t **pts, size_t neqs, const plane_t *eqs);
 
 
+/**
+ * bu_sort helper-function to sort an convex polygon counter-clockwise
+ *
+ * @param[in] x First point to compare
+ * @param[in] y Second point to compare
+ * @param[in] cmp Plane_t of the polygon, the two points are part of
+ *
+ * @return < 0 x goes before y
+ * @return 0 the points are identical
+ * @return > 0 y goes before x
+ */
+BN_EXPORT extern int bn_sort_helper_ccw(const void *x, const void *y, void *cmp);
+
 #endif /* BN_H */
 
 /** @} */
Index: src/libbn/polygon.c
===================================================================
--- src/libbn/polygon.c	(Revision 59269)
+++ src/libbn/polygon.c	(Arbeitskopie)
@@ -167,6 +167,15 @@
 }
 
 
+int
+bn_sort_helper_ccw(const void *x, const void *y, void *cmp)
+{
+    vect_t tmp;
+    VCROSS(tmp, ((fastf_t *)x), ((fastf_t *)y));
+    return VDOT(*((point_t *)cmp), tmp);
+}
+
+
 /*
  * Local Variables:
  * mode: C
Index: src/libged/analyze.c
===================================================================
--- src/libged/analyze.c	(Revision 59269)
+++ src/libged/analyze.c	(Arbeitskopie)
@@ -712,17 +712,6 @@
 }
 
 
-/* qsort helper function, used to sort points into
- * counter-clockwise order */
-HIDDEN int
-ccw(const void *x, const void *y, void *cmp)
-{
-    vect_t tmp;
-    VCROSS(tmp, ((fastf_t *)x), ((fastf_t *)y));
-    return VDOT(*((point_t *)cmp), tmp);
-}
-
-
 /**
  * A N A L Y Z E _ P O L Y _ F A C E
  *
@@ -746,7 +735,7 @@
     findang(angles, face->plane_eqn);
 
     /* sort points */
-    bu_sort(face->pts, face->npts, sizeof(point_t), ccw, &face->plane_eqn);
+    bu_sort(face->pts, face->npts, sizeof(point_t), bn_sort_helper_ccw, &face->plane_eqn);
     bn_polygon_area(&face->area, face->npts, (const point_t *)face->pts);
 
     /* store face information for pretty printing */
Index: src/librt/primitives/arbn/arbn.c
===================================================================
--- src/librt/primitives/arbn/arbn.c	(Revision 59269)
+++ src/librt/primitives/arbn/arbn.c	(Arbeitskopie)
@@ -1334,17 +1334,6 @@
 };
 
 
-/* bu_sort helper function, used to sort points into
- * counter-clockwise order */
-HIDDEN int
-ccw(const void *x, const void *y, void *cmp)
-{
-    vect_t tmp;
-    VCROSS(tmp, ((fastf_t *)x), ((fastf_t *)y));
-    return VDOT(*((point_t *)cmp), tmp);
-}
-
-
 static void
 rt_arbn_faces_area(struct poly_face* faces, struct rt_arbn_internal* aip)
 {
@@ -1362,7 +1351,7 @@
     bn_polygon_mk_pts_planes(npts, tmp_pts, aip->neqn, (const plane_t *)eqs);
     for (i = 0; i < aip->neqn; i++) {
 	faces[i].npts = npts[i];
-    	bu_sort(faces[i].pts, faces[i].npts, sizeof(point_t), ccw, &faces[i].plane_eqn);
+    	bu_sort(faces[i].pts, faces[i].npts, sizeof(point_t), bn_sort_helper_ccw, &faces[i].plane_eqn);
     	bn_polygon_area(&faces[i].area, faces[i].npts, (const point_t *)faces[i].pts);
     }
     bu_free((char *)tmp_pts, "rt_arbn_faces_area: tmp_pts");
Index: src/librt/primitives/bot/bot.c
===================================================================
--- src/librt/primitives/bot/bot.c	(Revision 59269)
+++ src/librt/primitives/bot/bot.c	(Arbeitskopie)
@@ -5276,17 +5276,6 @@
 }
 
 
-/* qsort helper function, used to sort points into
- * counter-clockwise order */
-HIDDEN int
-ccw_algo(const void *x, const void *y, void *cmp)
-{
-    vect_t tmp;
-    VCROSS(tmp, ((fastf_t *)x), ((fastf_t *)y));
-    return VDOT(*((point_t *)cmp), tmp);
-}
-
-
 void
 rt_bot_volume(fastf_t *volume, const struct rt_db_internal *ip)
 {
@@ -5338,7 +5327,7 @@
 	/* SURFACE AREA */
 
 	/* sort points */
-	bu_sort(face.pts, face.npts, sizeof(point_t), ccw_algo, &face.plane_eqn);
+	bu_sort(face.pts, face.npts, sizeof(point_t), bn_sort_helper_ccw, &face.plane_eqn);
 	bn_polygon_area(&face.area, face.npts, (const point_t *)face.pts);
 
 	/* VOLUME */
Index: src/librt/primitives/nmg/nmg.c
===================================================================
--- src/librt/primitives/nmg/nmg.c	(Revision 59269)
+++ src/librt/primitives/nmg/nmg.c	(Arbeitskopie)
@@ -3107,17 +3107,6 @@
 }
 
 
-/* bu_sort helper function, used to sort points into
- * counter-clockwise order */
-HIDDEN int
-nmg_ccw(const void *x, const void *y, void *cmp)
-{
-    vect_t tmp;
-    VCROSS(tmp, ((fastf_t *)x), ((fastf_t *)y));
-    return VDOT(*((point_t *)cmp), tmp);
-}
-
-
 /* contains information used to analyze a polygonal face */
 struct poly_face
 {
@@ -3157,7 +3146,7 @@
     bn_polygon_mk_pts_planes(npts, tmp_pts, num_faces, (const plane_t *)eqs);
     for (i = 0; i < num_faces; i++) {
 	faces[i].npts = npts[i];
-	bu_sort(faces[i].pts, faces[i].npts, sizeof(point_t), nmg_ccw, &faces[i].plane_eqn);
+	bu_sort(faces[i].pts, faces[i].npts, sizeof(point_t), bn_sort_helper_ccw, &faces[i].plane_eqn);
 	bn_polygon_area(&faces[i].area, faces[i].npts, (const point_t *)faces[i].pts);
     }
     bu_free((char *)tmp_pts, "rt_nmg_faces_area: tmp_pts");
