[Lldb-commits] [lldb] r163821 - /lldb/branches/windows/include/lldb/lldb-windows.h

Carlo Kok ck at remobjects.com
Thu Sep 13 11:38:48 PDT 2012


Author: carlokok
Date: Thu Sep 13 13:38:48 2012
New Revision: 163821

URL: http://llvm.org/viewvc/llvm-project?rev=163821&view=rev
Log:
Missing lldb-windows.h file for the Windows patch by Joao Matos

Added:
    lldb/branches/windows/include/lldb/lldb-windows.h

Added: lldb/branches/windows/include/lldb/lldb-windows.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-windows.h?rev=163821&view=auto
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-windows.h (added)
+++ lldb/branches/windows/include/lldb/lldb-windows.h Thu Sep 13 13:38:48 2012
@@ -0,0 +1,101 @@
+//===-- lldb-windows.h ------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef lldb_lldb_windows_h_
+#define lldb_lldb_windows_h_
+
+#if defined(__cplusplus)
+
+#ifdef _MSC_VER
+
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <Windows.h>
+
+// posix utilities
+#define snprintf _snprintf
+int vasprintf(char **ret, const char *fmt, va_list ap);
+
+int strcasecmp(const char* s1, const char* s2);
+int strncasecmp(const char* s1, const char* s2, size_t n);
+char * strcasestr(const char *s, const char* find);
+
+long long int strtoll(const char *nptr, char **endptr, int base);
+unsigned long long int strtoull(const char *nptr, char **endptr, int base);
+
+// missing posix declarations
+enum {
+  PATH_MAX = MAX_PATH
+};
+
+enum {
+  REG_EXTENDED
+};
+
+enum {
+  STDIN_FILENO = 0,
+  STDOUT_FILENO,
+  STDERR_FILENO
+};
+
+enum {
+  O_NOCTTY
+};
+
+enum {
+  SIGKILL
+};
+
+// missing socket types
+typedef short sa_family_t;
+typedef unsigned short in_port_t;
+
+// getopt()
+enum {
+  no_argument = 0,
+  required_argument,
+  optional_argument
+};
+
+struct option {
+    /* name of long option */
+    const char *name;
+    /*
+     * one of no_argument, required_argument, and optional_argument:
+     * whether option takes an argument
+     */
+    int has_arg;
+    /* if not NULL, set *flag to val when option found */
+    int *flag;
+    /* if flag not NULL, value to set *flag to; else return value */
+    int val;
+};
+
+int getopt(int argc, char * const argv[],
+    const char *optstring);
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+int getopt_long(int argc, char * const *argv,
+    const char *optstring,
+    const struct option *longopts, int *longindex);
+
+extern int optreset;
+
+// missing macros 
+#define __PRETTY_FUNCTION__ __FUNCSIG__
+#define va_copy(d,s) ((d) = (s))
+
+#endif
+
+#endif  // defined(__cplusplus)
+
+
+#endif  // lldb_lldb_windows_h_





More information about the lldb-commits mailing list