aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/tools
diff options
context:
space:
mode:
authorSteven Hartland <smh@FreeBSD.org>2015-01-17 14:44:59 +0000
committerSteven Hartland <smh@FreeBSD.org>2015-01-17 14:44:59 +0000
commitbc96366c864c07ef352edb92017357917c75b36c (patch)
tree09e9633064b6303a8afc6891fff761eb6e399cee /cddl/contrib/opensolaris/tools
parentb0b74fb366450ac61b7df38daa92bc19cbfc3ecc (diff)
downloadsrc-bc96366c864c07ef352edb92017357917c75b36c.tar.gz
src-bc96366c864c07ef352edb92017357917c75b36c.zip
Mechanically convert cddl sun #ifdef's to illumos
Since the upstream for cddl code is now illumos not sun, mechanically convert all sun #ifdef's to illumos #ifdef's which have been used in all newer code for some time. Also do a manual pass to correct the use if #ifdef comments as per style(9) as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. MFC after: 1 month Sponsored by: Multiplay
Notes
Notes: svn path=/head/; revision=277300
Diffstat (limited to 'cddl/contrib/opensolaris/tools')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c8
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h2
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c4
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c12
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c4
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/output.c6
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c2
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/util.c2
8 files changed, 20 insertions, 20 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
index bc278b063de1..c0719620dbde 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.c
@@ -38,7 +38,7 @@
*/
#include <pthread.h>
-#if defined(sun)
+#ifdef illumos
#include <synch.h>
#endif
#include <stdio.h>
@@ -49,7 +49,7 @@ void
barrier_init(barrier_t *bar, int nthreads)
{
pthread_mutex_init(&bar->bar_lock, NULL);
-#if defined(sun)
+#ifdef illumos
sema_init(&bar->bar_sem, 0, USYNC_THREAD, NULL);
#else
sem_init(&bar->bar_sem, 0, 0);
@@ -66,7 +66,7 @@ barrier_wait(barrier_t *bar)
if (++bar->bar_numin < bar->bar_nthr) {
pthread_mutex_unlock(&bar->bar_lock);
-#if defined(sun)
+#ifdef illumos
sema_wait(&bar->bar_sem);
#else
sem_wait(&bar->bar_sem);
@@ -80,7 +80,7 @@ barrier_wait(barrier_t *bar)
/* reset for next use */
bar->bar_numin = 0;
for (i = 1; i < bar->bar_nthr; i++)
-#if defined(sun)
+#ifdef illumos
sema_post(&bar->bar_sem);
#else
sem_post(&bar->bar_sem);
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h
index c7e6212a69c5..babf2e64e33f 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/barrier.h
@@ -33,7 +33,7 @@
* APIs for the barrier synchronization primitive.
*/
-#if defined(sun)
+#ifdef illumos
#include <synch.h>
#else
#include <semaphore.h>
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c
index efe6c279a0b7..d40be25da27f 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfconvert.c
@@ -155,7 +155,7 @@ main(int argc, char **argv)
int keep_stabs = 0;
int c;
-#if defined(sun)
+#ifdef illumos
sighold(SIGINT);
sighold(SIGQUIT);
sighold(SIGTERM);
@@ -221,7 +221,7 @@ main(int argc, char **argv)
*/
set_terminate_cleanup(terminate_cleanup);
-#if defined(sun)
+#ifdef illumos
sigset(SIGINT, handle_sig);
sigset(SIGQUIT, handle_sig);
sigset(SIGTERM, handle_sig);
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
index 3e030c7e251a..a3d05ad20b28 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
@@ -176,20 +176,20 @@
#include <unistd.h>
#include <pthread.h>
#include <assert.h>
-#if defined(sun)
+#ifdef illumos
#include <synch.h>
#endif
#include <signal.h>
#include <libgen.h>
#include <string.h>
#include <errno.h>
-#if defined(sun)
+#ifdef illumos
#include <alloca.h>
#endif
#include <sys/param.h>
#include <sys/types.h>
#include <sys/mman.h>
-#if defined(sun)
+#ifdef illumos
#include <sys/sysconf.h>
#endif
@@ -232,7 +232,7 @@ usage(void)
progname, progname);
}
-#if defined(sun)
+#ifdef illumos
static void
bigheap(void)
{
@@ -280,7 +280,7 @@ bigheap(void)
(void) memcntl(NULL, 0, MC_HAT_ADVISE, (caddr_t)&mha, 0, 0);
}
-#endif
+#endif /* illumos */
static void
finalize_phase_one(workqueue_t *wq)
@@ -707,7 +707,7 @@ start_threads(workqueue_t *wq)
(void *(*)(void *))worker_thread, wq);
}
-#if defined(sun)
+#ifdef illumos
sigset(SIGINT, handle_sig);
sigset(SIGQUIT, handle_sig);
sigset(SIGTERM, handle_sig);
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
index 5dfeab3c0bea..b7cb66fee9ab 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
@@ -1390,7 +1390,7 @@ die_base_type2enc(dwarf_t *dw, Dwarf_Off off, Dwarf_Signed enc, size_t sz)
mult = 2;
col = 1;
} else if (enc == DW_ATE_imaginary_float
-#if defined(sun)
+#ifdef illumos
|| enc == DW_ATE_SUN_imaginary_float
#endif
)
@@ -1441,7 +1441,7 @@ die_base_from_dwarf(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, size_t sz)
case DW_ATE_float:
case DW_ATE_complex_float:
case DW_ATE_imaginary_float:
-#if defined(sun)
+#ifdef illumos
case DW_ATE_SUN_imaginary_float:
case DW_ATE_SUN_interval_float:
#endif
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/output.c b/cddl/contrib/opensolaris/tools/ctf/cvt/output.c
index af797690a259..3131e7fb85ee 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/output.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/output.c
@@ -576,7 +576,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname,
shdr.sh_name);
}
-#if !defined(sun)
+#ifndef illumos
if (gelf_update_shdr(dscn, &shdr) == 0)
elfterminate(dstname, "Cannot update sect %s", sname);
#endif
@@ -585,7 +585,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname,
elfterminate(srcname, "Cannot get sect %s data", sname);
if ((ddata = elf_newdata(dscn)) == NULL)
elfterminate(dstname, "Can't make sect %s data", sname);
-#if defined(sun)
+#ifdef illumos
bcopy(sdata, ddata, sizeof (Elf_Data));
#else
/*
@@ -645,7 +645,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname,
}
}
-#if !defined(sun)
+#ifndef illumos
if (ddata->d_buf == NULL && sdata->d_buf != NULL) {
ddata->d_buf = xmalloc(shdr.sh_size);
bcopy(sdata->d_buf, ddata->d_buf, shdr.sh_size);
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c b/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c
index 1ccd6cde5f59..d1a1ad0e7d05 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/tdata.c
@@ -173,7 +173,7 @@ tdesc_namecmp(void *arg1, void *arg2)
return (!streq(tdp1->t_name, tdp2->t_name));
}
-#if defined(sun)
+#ifdef illumos
/*ARGSUSED1*/
static int
tdesc_print(void *data, void *private __unused)
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
index 82dfe63ad579..fb76cbaeb422 100644
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c
@@ -171,7 +171,7 @@ aborterr(const char *format, ...)
whine("ERROR", format, ap);
va_end(ap);
-#if defined(sun)
+#ifdef illumos
abort();
#else
exit(0);