Home | History | Annotate | Download | only in include
      1 /*
      2    Copyright (c) 2011 mingw-w64 project
      3 
      4    Permission is hereby granted, free of charge, to any person obtaining a
      5    copy of this software and associated documentation files (the "Software"),
      6    to deal in the Software without restriction, including without limitation
      7    the rights to use, copy, modify, merge, publish, distribute, sublicense,
      8    and/or sell copies of the Software, and to permit persons to whom the
      9    Software is furnished to do so, subject to the following conditions:
     10 
     11    The above copyright notice and this permission notice shall be included in
     12    all copies or substantial portions of the Software.
     13 
     14    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     15    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     16    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     17    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     18    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     19    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     20    DEALINGS IN THE SOFTWARE.
     21 */
     22 
     23 /*
     24  * Parts of this library are derived by:
     25  *
     26  * Posix Threads library for Microsoft Windows
     27  *
     28  * Use at own risk, there is no implied warranty to this code.
     29  * It uses undocumented features of Microsoft Windows that can change
     30  * at any time in the future.
     31  *
     32  * (C) 2010 Lockless Inc.
     33  * All rights reserved.
     34  *
     35  * Redistribution and use in source and binary forms, with or without modification,
     36  * are permitted provided that the following conditions are met:
     37  *
     38  *
     39  *  * Redistributions of source code must retain the above copyright notice,
     40  *    this list of conditions and the following disclaimer.
     41  *  * Redistributions in binary form must reproduce the above copyright notice,
     42  *    this list of conditions and the following disclaimer in the documentation
     43  *    and/or other materials provided with the distribution.
     44  *  * Neither the name of Lockless Inc. nor the names of its contributors may be
     45  *    used to endorse or promote products derived from this software without
     46  *    specific prior written permission.
     47  *
     48  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AN
     49  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     50  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     51  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     52  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     53  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     54  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     55  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     56  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
     57  * OF THE POSSIBILITY OF SUCH DAMAGE.
     58  */
     59 
     60 #ifndef WIN_PTHREADS_PTHREAD_COMPAT_H
     61 #define WIN_PTHREADS_PTHREAD_COMPAT_H
     62 
     63 #ifdef __GNUC__
     64 
     65 #define WINPTHREADS_INLINE inline
     66 #define WINPTHREADS_ATTRIBUTE(X) __attribute__(X)
     67 #define WINPTHREADS_SECTION(X) __section__(X)
     68 
     69 #elif _MSC_VER
     70 
     71 #include "pthread_time.h"
     72 
     73 #ifdef _WIN64
     74 typedef __int64 pid_t;
     75 #else
     76 typedef int     pid_t;
     77 #endif
     78 typedef int clockid_t;
     79 
     80 #define WINPTHREADS_INLINE __inline
     81 #define WINPTHREADS_ATTRIBUTE(X) __declspec X
     82 #define WINPTHREADS_SECTION(X) allocate(X)
     83 
     84 #endif
     85 
     86 #endif
     87