summaryrefslogtreecommitdiff
path: root/liboffloadmic/runtime/offload_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'liboffloadmic/runtime/offload_util.h')
-rw-r--r--liboffloadmic/runtime/offload_util.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/liboffloadmic/runtime/offload_util.h b/liboffloadmic/runtime/offload_util.h
index 2cffd82f70a..894355aca7a 100644
--- a/liboffloadmic/runtime/offload_util.h
+++ b/liboffloadmic/runtime/offload_util.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -31,14 +31,23 @@
#ifndef OFFLOAD_UTIL_H_INCLUDED
#define OFFLOAD_UTIL_H_INCLUDED
-#include <stdio.h>
#include <stdlib.h>
-#include <stdint.h>
#ifdef TARGET_WINNT
+ #define DLL_LOCAL
+#else
+ #define DLL_LOCAL __attribute__((visibility("hidden")))
+#endif
+
+#ifdef TARGET_WINNT
+// Don't use <stdint.h> as compiling with VS2010 makes ofldbegin.obj
+// incompatible with STL library of versions older than VS2010.
+typedef unsigned long long int uint64_t;
+typedef signed long long int int64_t;
#include <windows.h>
#include <process.h>
#else // TARGET_WINNT
+#include <stdint.h>
#include <dlfcn.h>
#include <pthread.h>
#endif // TARGET_WINNT
@@ -143,7 +152,7 @@ int DL_addr(const void *addr, Dl_info *info);
#define DL_addr(addr, info) dladdr((addr), (info))
#endif // TARGET_WINNT
-extern void* DL_sym(void *handle, const char *name, const char *version);
+DLL_LOCAL extern void* DL_sym(void *handle, const char *name, const char *version);
// One-time initialization API
#ifdef TARGET_WINNT
@@ -159,13 +168,13 @@ typedef pthread_once_t OffloadOnceControl;
#endif // TARGET_WINNT
// Parses size specification string.
-extern bool __offload_parse_size_string(const char *str, uint64_t &new_size);
+DLL_LOCAL extern bool __offload_parse_size_string(const char *str, uint64_t &new_size);
// Parses string with integer value
-extern bool __offload_parse_int_string(const char *str, int64_t &value);
+DLL_LOCAL extern bool __offload_parse_int_string(const char *str, int64_t &value);
// get value by its base, offset and size
-int64_t get_el_value(
+DLL_LOCAL int64_t get_el_value(
char *base,
int64_t offset,
int64_t size