aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/compat.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/compat.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/compat.h')
-rw-r--r--util/system/compat.h96
1 files changed, 48 insertions, 48 deletions
diff --git a/util/system/compat.h b/util/system/compat.h
index c53dbcca17..01ec1b0b7d 100644
--- a/util/system/compat.h
+++ b/util/system/compat.h
@@ -1,84 +1,84 @@
#pragma once
-#include "defaults.h"
-
-#include <cstdarg>
-
+#include "defaults.h"
+
+#include <cstdarg>
+
#include <csignal>
-#if defined(_unix_)
- #include <unistd.h>
-#endif
-
-#if defined(_win_)
- #include <process.h>
+#if defined(_unix_)
+ #include <unistd.h>
+#endif
+
+#if defined(_win_)
+ #include <process.h>
#endif
extern "C" {
-#if defined(_win_)
- using pid_t = int;
-
- inline unsigned int alarm(unsigned int /*seconds*/) {
- return 0; // no alarm is currently set :)
- }
-
- #define SIGQUIT SIGBREAK // instead of 3
- #define SIGKILL SIGTERM // instead of 9
- #define SIGPIPE 13 //will not receive under win?
- #define SIGALRM 14 //will not receive under win?
-#endif
-
+#if defined(_win_)
+ using pid_t = int;
+
+ inline unsigned int alarm(unsigned int /*seconds*/) {
+ return 0; // no alarm is currently set :)
+ }
+
+ #define SIGQUIT SIGBREAK // instead of 3
+ #define SIGKILL SIGTERM // instead of 9
+ #define SIGPIPE 13 //will not receive under win?
+ #define SIGALRM 14 //will not receive under win?
+#endif
+
#if defined(__FreeBSD__) || defined(_darwin_)
- #define HAVE_NATIVE_GETPROGNAME
+ #define HAVE_NATIVE_GETPROGNAME
#endif
#ifndef HAVE_NATIVE_GETPROGNAME
- const char* getprogname();
+ const char* getprogname();
#endif
-#if defined(_MSC_VER)
- void err(int e, const char* m, ...);
- void errx(int e, const char* m, ...);
- void warn(const char* m, ...);
- void warnx(const char* m, ...);
- void vwarnx(const char* format, va_list ap);
- void vwarn(const char* format, va_list ap);
- void verrx(int status, const char* format, va_list ap);
+#if defined(_MSC_VER)
+ void err(int e, const char* m, ...);
+ void errx(int e, const char* m, ...);
+ void warn(const char* m, ...);
+ void warnx(const char* m, ...);
+ void vwarnx(const char* format, va_list ap);
+ void vwarn(const char* format, va_list ap);
+ void verrx(int status, const char* format, va_list ap);
#else
- #include <err.h>
+ #include <err.h>
#endif
-}
+}
#ifdef _MSC_VER
- #define popen _popen
- #define pclose _pclose
+ #define popen _popen
+ #define pclose _pclose
#endif
#ifdef _win_
- #define NAME_MAX FILENAME_MAX
+ #define NAME_MAX FILENAME_MAX
#endif
#ifdef _sun_
- #define NAME_MAX PATH_MAX
+ #define NAME_MAX PATH_MAX
#endif
#ifdef _win_
- #ifdef sleep // may be defined by perl
- #undef sleep
- #endif
+ #ifdef sleep // may be defined by perl
+ #undef sleep
+ #endif
void sleep(i64 len);
void usleep(i64 len);
-#endif
+#endif
#ifdef _win_
int ftruncate(int fd, i64 length);
int truncate(const char* name, i64 length);
#endif
-#if defined(GNUC)
- #ifndef va_copy
- #define va_copy __va_copy
- #endif
-#endif
+#if defined(GNUC)
+ #ifndef va_copy
+ #define va_copy __va_copy
+ #endif
+#endif