Author: jfarrell
Date: Fri Jun 22 03:51:38 2012
New Revision: 1352767
URL: http://svn.apache.org/viewvc?rev=1352767&view=rev
Log:
THRIFT-1438: lib/cpp/src/windows/config.h should read version from configure.ac
rather than a #define
Client: compiler
Patch: Jake Farrell
Converts compiler/cpp/src/windows/version.h to a template and automates uses of
configure.ac version rather than a random #define version string.
Added:
thrift/trunk/compiler/cpp/src/windows/version.h.in
Removed:
thrift/trunk/compiler/cpp/src/windows/version.h
Modified:
thrift/trunk/compiler/cpp/Makefile.am
thrift/trunk/configure.ac
Modified: thrift/trunk/compiler/cpp/Makefile.am
URL:
http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/Makefile.am?rev=1352767&r1=1352766&r2=1352767&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/Makefile.am (original)
+++ thrift/trunk/compiler/cpp/Makefile.am Fri Jun 22 03:51:38 2012
@@ -105,6 +105,6 @@ EXTRA_DIST = \
$(WINDOWS_DIST)
clean-local:
- $(RM) thriftl.cc thrifty.cc thrifty.h version.h
+ $(RM) thriftl.cc thrifty.cc thrifty.h version.h windows/version.h
src/main.cc: version.h
Added: thrift/trunk/compiler/cpp/src/windows/version.h.in
URL:
http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/windows/version.h.in?rev=1352767&view=auto
==============================================================================
--- thrift/trunk/compiler/cpp/src/windows/version.h.in (added)
+++ thrift/trunk/compiler/cpp/src/windows/version.h.in Fri Jun 22 03:51:38 2012
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding cogoright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a cogo of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef _THRIFT_WINDOWS_VERSION_H_
+#define _THRIFT_WINDOWS_VERSION_H_ 1
+
+#if defined(_MSC_VER) && (_MSC_VER > 1200)
+#pragma once
+#endif // _MSC_VER
+
+#ifndef _WIN32
+#error "This is a Windows header only"
+#endif
+
+#define PATH_MAX MAX_PATH
+#define THRIFT_VERSION "@PACKAGE_VERSION@"
+
+#ifndef S_ISDIR
+#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
+#endif
+
+#ifndef S_ISREG
+#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
+#endif
+
+#endif // _THRIFT_WINDOWS_VERSION_H_
Modified: thrift/trunk/configure.ac
URL:
http://svn.apache.org/viewvc/thrift/trunk/configure.ac?rev=1352767&r1=1352766&r2=1352767&view=diff
==============================================================================
--- thrift/trunk/configure.ac (original)
+++ thrift/trunk/configure.ac Fri Jun 22 03:51:38 2012
@@ -574,6 +574,7 @@ AC_CONFIG_FILES([
Makefile
compiler/cpp/Makefile
compiler/cpp/version.h
+ compiler/cpp/src/windows/version.h
lib/Makefile
lib/cpp/Makefile
lib/cpp/test/Makefile