/* Copyright (c) 2015, ENEA Software AB
 * Copyright (c) 2015, Nokia
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#ifndef __OFP_ODP_COMPAT__
#define __OFP_ODP_COMPAT__

#if ODP_VERSION == 102
#include "linux.h"
#else
#include "odp/helper/linux.h"
#endif /* odp_version == 102 */

#if ODP_VERSION < 105
typedef uint64_t odp_time_t;
#endif /* ODP_VERSION < 105 */

#if ODP_VERSION < 104 && ODP_VERSION > 101
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
#elif ODP_VERSION < 102
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
#define odp_init_local(x) odp_init_local()
#define ODP_THREAD_WORKER 0
#define ODP_THREAD_CONTROL 1
#endif

#endif
/* Copyright (c) 2015, ENEA Software AB
 * Copyright (c) 2015, Nokia
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#ifndef __OFP_ODP_COMPAT__
#define __OFP_ODP_COMPAT__

#if ODP_VERSION == 102
#include "linux.h"
#else
#include "odp/helper/linux.h"
#endif /* odp_version == 102 */

#if ODP_VERSION < 105
typedef uint64_t odp_time_t;
#endif /* ODP_VERSION < 105 */

#if ODP_VERSION < 104 && ODP_VERSION > 101
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
#elif ODP_VERSION < 102
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
#define ODP_THREAD_WORKER
#define ODP_THREAD_CONTROL
#endif

#endif
--- 
+++ 
@@ -22,8 +22,9 @@
 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
 #elif ODP_VERSION < 102
 #define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
-#define ODP_THREAD_WORKER
-#define ODP_THREAD_CONTROL
+#define odp_init_local(x) odp_init_local()
+#define ODP_THREAD_WORKER 0
+#define ODP_THREAD_CONTROL 1
 #endif
 
 #endif
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL as in it's original enum, instead of mangling them.

Defining odp_init_local like this we can initialized properly the
values of ODP_THREAD_WORKER and ODP_THREAD_CONTROL. This is important
for the following patch where we need to define odp_threat_type_t.

Signed-off-by: José Pekkarinen <d7cb8761fb0e75b1a78c2fda4f1daed76cd46cfe@nokia.com>
Reviewed-and-tested-by: Sorin Vultureanu <8013ba55f8675034bc2ab0d6c3a1c9650437ca36@enea.com>
